URL: https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/Animation.Stop.html
: 'dataLayer-initialized', user: { user_unity_id: undefined, user_logged_in: 'no' }, environment: { environment_locale: 'en-us', environment_currency: undefined }});Stops all playing animations that were started with this Animation.
Stopping an animation also Rewinds it to the Start.
using UnityEngine;
public class ExampleScript : MonoBehaviour { Animation anim;
void Start() { anim = GetComponent<Animation>(); }
void Update() { if (Input.GetButtonDown("Jump") && anim.isPlaying) { anim.Stop(); } } }
Stops an animation named name.
Stopping an animation also Rewinds it to the Start.
using UnityEngine;
public class ExampleScript : MonoBehaviour { Animation anim;
void Start() { anim = GetComponent<Animation>(); }
void Update() { if (Input.GetButtonDown("Jump") && anim.isPlaying) { anim.Stop("CubeJump"); } } }