- Home /
Animations in booleans loop?
var isClipPlaying : boolean;
function Start () { }
function Update () {
if (Input.GetButtonDown ("Fire1")) {
isClipPlay = !isClipPlaying;
}
if (isClipPlaying)
animation.Play("myClip");
}
myClip repeats. How can it be fixed?
Comment
Edit the question and post your code. It seems you're repeatedly calling Play at Update, but we can't help you without your code.
Answer by Jessespike · Oct 14, 2012 at 06:37 PM
When you do not want animations to loop anymore, set the animation wrap mode to Once.
animation.clip.wrapMode = WrapMode.Once;
I can understand why it would loop. The animation is set to play as long as the boolean is true.
Wrap mode doesn't seem to work.