Closed Aegistus closed 1 year ago
In order to play animations in a script, call GetComponent(), then call the Play() method. https://docs.unity3d.com/ScriptReference/Animator.Play.html The method takes either the string name for the animation state in the animator controller, or an integer hash for that same string. Using the hash is better for performance, and you can get it by calling Animator.StringToHash(); https://docs.unity3d.com/ScriptReference/Animator.StringToHash.html
In order to play animations in a script, call GetComponent(), then call the Play() method.
https://docs.unity3d.com/ScriptReference/Animator.Play.html
The method takes either the string name for the animation state in the animator controller, or an integer hash for that same string. Using the hash is better for performance, and you can get it by calling Animator.StringToHash();
https://docs.unity3d.com/ScriptReference/Animator.StringToHash.html