I have this function to play an animation then wait a few seconds then it changes the Boolean to false to stop the animation. I can't get it to work, he doesn't stop looping the animation. Is there a better way to do this? How can I make it so that he just plays the animation once and doesn't loop it? Also, here's my code, which probably sucks.
function KnifeThrow()
{
var myAnimator: Animator= GetComponent(Animator);
myAnimator.SetBool("Throw Knife",true); ;
yield WaitForSeconds(2);
myAnimator.SetBool("Throw Knife",false);
}
↧