Hi,
I have a low poly character with 3 animations: runforward, idle and jump
Based on the status of the UP cursor key I can make this character run forward and idle, but when I press spacebar , I want the character to JUMP.
Now jumping in the code below WORKS, but I have to keep the spacebar pushed down to let it finish the jump animation.
Question: Is there an easy way to change the code below so that I can force my jump animation to play when pushing down spacebar( even if its only for a very short while being pushed down) and then force the system to only start playing idle or runforward again after the jump animation is completely finished playing ?
CODE BELOW:
function Update ()
{
if (Input.GetAxis(“Vertical”) > 0.2) animation.CrossFade (“runforward”);
else
animation.CrossFade (“idle”);
if (Input.GetKey (“space”)) animation.CrossFade(“jump”);
}