unity if animator is playing code example
Example 1: how to know if the animator playing animation unity
bool AnimatorIsPlaying(){ return animator.GetCurrentAnimatorStateInfo(0).length > animator.GetCurrentAnimatorStateInfo(0).normalizedTime; }
Example 2: unity detect if animation is playing
if(this.GetComponent<Animator>().GetCurrentAnimatorStateInfo(0).normalizedTime >= 1)
{
//Do something when animator isn't playing
{