How to check if animator is in crossfade

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);
		}

For anything,
Do in a line on its own (for what you listed, I’d do it under "anim.CrossFade (“uppercut”, 0.1f, 0);

Do Debug.Log(“Enter message here”);

This will allow it so when it gets to that point, it would say in the inspector “Enter text Here”

Another way to do this is print(“Message”);