- Home /
Animation stop looping script?
I need one because i couldn't find it. and I used legacy version. I followed a tutorial a while ago and It would take all day to redo it. whats the stop looping animation script?
Anyone else having issues with this? seems like it should be so easy:
I have a looping anim that I want to stop at the end of the current iteration.
Set the wrap$$anonymous$$ode to Wrap$$anonymous$$ode.Once or Wrap$$anonymous$$ode.Clamp or Wrap$$anonymous$$ode.ClampForever on the looping anim, and the animation stops dead, doesn't play through the current loop.
Doesn't matter if I set the wrap$$anonymous$$ode on the gameObject.animation or gameObject.animation["anim"], the looping immediately halts and snaps to the last anim frame (I'm assu$$anonymous$$g.. that's what it looks like, who knows?).
Not playing any other animation, not queueing nor playing nor crossfading, only setting the wrap$$anonymous$$ode. The animation has a Wrap $$anonymous$$ode of loop by default.
Is there some secret trick somewhere, maybe in some other settings?
any suggestions would be appreciated.
Answer by Cherno · Apr 29, 2014 at 03:06 PM
You just call Animation.wrapmode
// Make the animation loop
animation.wrapMode = WrapMode.Loop;
// Make the animation play once
animation.wrapMode = WrapMode.Once;
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Animation Keeps Looping 2 Answers
cant stop my animation 0 Answers
Making an animation stop once it finishes (trouble with booleans) 1 Answer
Stop animation from playing 1 Answer