- Home /
Can't get Animation to stop
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);
}
Your answer
Follow this Question
Related Questions
How to call a c-sharp function from javascript? 1 Answer
Update function doesn't work correctly 1 Answer
Where does a Raycast come from? 1 Answer
Can someone help me fix my Javascript for Flickering Light? 6 Answers
Help with Functions 3 Answers