Back to Writing
NOTESunityanimationlegacyscripting
Unity Legacy Animation: Debug Mode Setup and Playback
November 2, 2019•Updated Feb 17, 2026

Click on the created animation and in the Inspector:

Click the dropdown next to the lock icon, then click Debug to switch to the view shown above.
At this point, check the Legacy checkbox (underlined).
How to Play:
public Animation anim;
anim.Play();
anim.Stop();
If there's only one animation clip, you don't need to specify the name in the parentheses.