Answers for "unity ui animation with code"

C#
12

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

C# Answers by Framework

Browse Popular Code Answers by Language