Answers for "how to start animation of object unity"

C#
4

how to get the current gameobject animator in unity

Animator animator = this.GetComponent<Animator>();
Posted by: Guest on August-16-2020
8

how to play animation with code in unity

public GameObject ExampleNPC;

void Update()
{
    if(Input.GetButtonDown("Animation")) // Make sure to refrence this in Input settings
    {
        ExampleNPC.GetComponent<Animator>().Play("Anim name");
    }
}
Posted by: Guest on August-04-2020

Code answers related to "how to start animation of object unity"

C# Answers by Framework

Browse Popular Code Answers by Language