Hi!
I have written a script, that only performs an action if the animator is in it’s idle state. I realized that it looked kind of clunky, so I changed the animation from animator.play to animator.crossfade, but now it will repeat the animation from the start if it’s currently crossfading, but not if the crossfade is over and the animation is playing. How do I check if my animator is crossfading or prevent it from looping during the fade?
if (Input.GetKeyDown (KeyCode.J) && anim.GetCurrentAnimatorStateInfo(0).IsName("fighting_idle") ) {
anim.CrossFade ("uppercut", 0.1f, 0);
}