Answers for "play animation through script unity"

C#
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
5

play animation through script unity

animator.Play("StateName");
Posted by: Guest on June-30-2020

Code answers related to "play animation through script unity"

C# Answers by Framework

Browse Popular Code Answers by Language