Hi, i want to play a animation on my character and it’s work fine. But i have to hold the key while the animation play. If i just press the key, the animation stop. Can you help me.
Function ADNdrain
{
animation.CrossFade(“ADNdrain”);
}
this is the code that me and my class used throughout a project pretty much, u press the button, it tells the function to start playing.
we created a function that would play the animation instead of just using like you did but that was because we went off of the 2d platformer tutorial and they had it that way so we just kept our structure the same. So just create a new function named whatever and make it SendMessage (“whatevername”) then tell it to play in the function
if that doesn’t work u could try changing animation.CrossFade to animation.Play
What was your problem?
I’m having the same problem. I want to have my character crouch when I hit GetButtonDown. (One button press and it crouches). But I only get like 3 frames of animation!!!