- Home /
Animation Wrap Mode Usage?
Has anyone had success using the wrapMode member in the Animation component?
The documentation states: "By default wrapMode(AnimationState.wrapMode) is initialized to the value set in the Animation component's wrap mode." http://unity3d.com/support/documentation/ScriptReference/AnimationState-wrapMode.html
And, it states: "If the WrapMode of an AnimationState is set to Default, the animation system will use the WrapMode from the Animation component." http://unity3d.com/support/documentation/ScriptReference/WrapMode.html
But, if I set the animation component's wrap mode to say "wrapMode.ClampForever" all AnimationStates with a wrapMode of "wrapMode.Default" still play as if they are using "wrapMode.Once" and not "wrapMode.ClampForever." Is this a bug or do I misunderstand the usage?
Answer by Anxo · Jun 09, 2011 at 11:40 AM
This does not happen to me, Clamp Forever will replay the last frame, which is like freezing the last frame of the animation if the animation came to an end. My animation is set to default and it is doing just that.
If you are trying to achieve this result but you are not having any luck with default, default might be switched in the import settings.
You could try using this code on your animation script
animation["animationClipName"].wrapMode = WrapMode.ClampForever;
let me know if that was of any help.
Your answer
Follow this Question
Related Questions
Trouble with animation wrap mode-animation plays randomly 1 Answer
How to Play an animation state on an animator controller on collision? 1 Answer
Die animation in animator reset model when finished. 0 Answers
Death animation play more than once 1 Answer
Toggling between states of animation 1 Answer