- Home /
How do you specify the type of animation looping?
Hi everyone. I want an animation to play and just stop forever when it is finished. The animation is controlled by a trigger and at the moment, everytime you roll over the trigger the door opens. I dont want that. I want so that the trigger goes inactive after you roll over it once. Also i was wondering if you could specify what kind of loop you want in a script. (Normal, LoopForever, Ping-Pong, etc.)
animation.Play ("Take 001");
Thanks, Alias
Answer by Mike 3 · Sep 12, 2010 at 12:36 PM
You'd use animation.wrapMode:
animation.wrapMode = WrapMode.Loop;
http://unity3d.com/support/documentation/ScriptReference/Animation-wrapMode.html
Alternatively, you could change the wrap mode for the specific animation state:
animation["Take 001"].wrapMode = WrapMode.Loop
http://unity3d.com/support/documentation/ScriptReference/AnimationState-wrapMode.html
Your answer
Follow this Question
Related Questions
My animation only plays on loop 1 Answer
Abaut Mecanim animation roop 0 Answers
Transition Animations at end of current loop 0 Answers
Can the animation editor create local rotational data? 3 Answers