2D Toolkit Forum
2D Toolkit => Support => Topic started by: Tylernocks on April 18, 2013, 08:53:30 pm
-
void Running()
{
anim.Play("Forward");
anim.animationCompleteDelegate = null;
}
I have a code here and it only plays after I let go of the button, when I hold the axis it only plays the first frame and stops.
its C#, and is active with GetAxisRaw.
-
It plays the first frame and stops because you're calling anim.Play every frame. That restarts the animation every frame.
You should do this -
if (!anim.IsPlaying("Forward")) {
anim.Play("Forward");
}