Wojciech Burda
0
Q:

unity animator check if animation is playing

bool isPlaying(Animator anim, string stateName)
{
    if (anim.GetCurrentAnimatorStateInfo(animLayer).IsName(stateName) &&
            anim.GetCurrentAnimatorStateInfo(animLayer).normalizedTime < 1.0f)
        return true;
    else
        return false;
}
0
  bool AnimatorIsPlaying(){     return animator.GetCurrentAnimatorStateInfo(0).length >            animator.GetCurrentAnimatorStateInfo(0).normalizedTime;  }
0

New to Communities?

Join the community