I have added an idle and jump animation to a character in unity. I can make the animation happen when the button is pressed. If the button is up middle at the animation the character goes to the idle position. But I want the whole animation happen in one press to the button and then go back to the idle position. My current script and Animator views are:
if (Input.GetKeyDown(KeyCode.Space))
{
Anim.SetBool("is_jumping", true);
ApplyInput(moveAxis, turnAxis);
}
else if (Input.GetKeyUp(KeyCode.Space))
{
Anim.SetBool("is_jumping", false);
}