Back to Writing
NOTESunityanimationanimatormecanimgame-dev

Unity - Animation State Reset with Animator.Play

July 5, 2020Updated Feb 17, 2026

![](

Ofs4g.VaUbt1BmR9p_EY6XfGSWhE-SGfMvPDeaKHs2wg0VGmgg.JPEG.cdw0424/photo-1439436556258-1f7fab1bfd4f.jpg?type=w966)

_Animator.Play("StateName", -1, 0f);

Writing and executing the code above will restart the state from the beginning, even if the state is currently mid-animation.

This kind of code is extremely useful for clicker games.

*For those who might find this confusing: in Unity Mecanim (Animator), each state can contain one or more animations, and you can combine animations to implement a single action.

Of course, if you put only one animation in a state, that single animation plays to completion.

Therefore, controlling states is effectively the same as controlling animations.