Version: 2023.1
LanguageEnglish
  • C#

WrapMode

enumeration

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Determines how time is treated outside of the keyframed range of an AnimationClip or AnimationCurve.

The WrapMode that the animation system uses for a specific animation is determined this way:
You can set the WrapMode of an AnimationClip in the import settings of the clip. This is the recommended way to control the WrapMode.
When an AnimationState is created, it inherits its WrapMode from the AnimationClip it is created from, but you can also change it from code.
If the WrapMode of an AnimationState is set to Default, the animation system will use the WrapMode from the Animation component.

Properties

OnceWhen time reaches the end of the animation clip, the clip will automatically stop playing and time will be reset to beginning of the clip.
LoopWhen time reaches the end of the animation clip, time will continue at the beginning.
PingPongWhen time reaches the end of the animation clip, time will ping pong back between beginning and end.
DefaultReads the default repeat mode set higher up.
ClampForeverPlays back the animation. When it reaches the end, it will keep playing the last frame and never stop playing.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961