is there a way to stop an animation from playing if it is already playing?
something like if (animation.isPlaying("run"){ !animation.Play("run"); }
^^ btw that doesnt seem to work
is there a way to stop an animation from playing if it is already playing?
something like if (animation.isPlaying("run"){ !animation.Play("run"); }
^^ btw that doesnt seem to work
if (!animation.IsPlaying("run") && Input.GetKeyDown ("w"))
{
}
else{
animation.Play("mouseOverEffect");
}
Maybe that's what you mean? You need to capitalize the i in Is.
http://unity3d.com/support/documentation/ScriptReference/Animation.IsPlaying.html
You want to stop animation if it's already playing? Then try this:
if (animation.IsPlaying("run"))
{
animation.Stop("run");
}