Aegistus / Untitled-Pirate-Game

Made for CS 325 Group Game Project
0 stars 0 forks source link

Add Ship Sinking #29

Closed Aegistus closed 1 year ago

Aegistus commented 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