Question by
jmook · Jun 27, 2017 at 06:12 PM ·
2d game2d sprites2d animation
How do I get my animation to only play once
I'm trying to get a punch animation to play once after pressing Z, but right now it continues to loop after i let go of the button. I've messed around with the code a bit but it just made different problems instead of fixing this one. My code is below, it's very basic, please help.
if (Input.GetKey(KeyCode.Z))
{
Punch = true;
anim.SetBool("Punch", true);
}
Comment