Problem in animation script.

Hello guys. I’ve faced a problem in animating my character in Runner game.

if (transform.position.x > -6.4f  transform.position.x < 0.43f)
			
{
			  animation.Play("side");
}


	if (transform.position.x > 0.46f)

{

			if(Input.GetKeyDown(KeyCode.H))
				animation.CrossFade("throw");
			else animation.CrossFade("walk");

}

if (transform.position.x < 6.4f)

{

			if(Input.GetKeyDown(KeyCode.H))
				animation.CrossFade("throw");
			else animation.CrossFade("walk");

}

So, my character replays animations SIDE and WALK perfectly well. But animation THROW is not replayed at all. How do you think, what’s the problem?

What happens when you press H is that you start to crossfade into “throw”, then the next frame, you’re no longer pressing H down ( GetKeyDown is 1 frame), so you go back to crossfading into “walk”. You have to delay the return to “walk” to after “throw” has finished playing.