Jump to content

(1.16.5 MCP) animate an item (multiple animations) when something happens


Recommended Posts

Posted

i know is weird, for example i made a 3d model of a gun, if i right click the gun rotates up a bit, if i shift the gun moves down a bit, that kind of animations but i dont want 3 guns each of them with a different animation

in unity i made this revolver's

public GameObject revolver;

IEnumerator animation()
    {
        revolver.transform.Rotate(new Vector3(0,3,0));
        yield return new WaitForSeconds(0.01f);
        revolver.transform.Rotate(new Vector3(0,6,0));
        yield return new WaitForSeconds(0.01f);
        revolver.transform.Rotate(new Vector3(0,9,0));
        yield return new WaitForSeconds(0.01f);
        revolver.transform.Rotate(new Vector3(0,12,0));
        yield return new WaitForSeconds(0.01f);
        revolver.transform.Rotate(new Vector3(0,-3,0));
        yield return new WaitForSeconds(0.01f);
        revolver.transform.Rotate(new Vector3(0,-6,0));
        yield return new WaitForSeconds(0.01f);
        revolver.transform.Rotate(new Vector3(0,-9,0));
        yield return new WaitForSeconds(0.01f);
        revolver.transform.Rotate(new Vector3(0,-12,0));
    }

void AnimateRevolver()
    {
        StartCoroutine(animation());
    }

when i want i call "AnimateRevolver" (again in unity), so i want to make something similar in java minecraft

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.