# WrapMode

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

## Definition

* **Type:** Enum
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public enum WrapMode
```

## Remarks

The WrapMode that the animation system uses for a specific animation is determined this way:

You can set the WrapMode of an [AnimationClip](/engine/6000.7/script-reference/unityengine/animationclip.md) in the import settings of the clip. This is the recommended way to control the WrapMode.

When an [AnimationState](/engine/6000.7/script-reference/unityengine/animationstate.md) is created, it inherits its WrapMode from the [AnimationClip](/engine/6000.7/script-reference/unityengine/animationclip.md) it is created from, but you can also change it from code.

If the WrapMode of an [AnimationState](/engine/6000.7/script-reference/unityengine/animationstate.md) is set to Default, the animation system will use the WrapMode from the [Animation](/engine/6000.7/script-reference/unityengine/animation.md) component.

## Fields

| Value                                                                                | Description                                                                                                                                |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| [ClampForever](/engine/6000.7/script-reference/unityengine/wrapmode/clampforever.md) | Plays back the animation. When it reaches the end, it will keep playing the last frame and never stop playing.                             |
| [Default](/engine/6000.7/script-reference/unityengine/wrapmode/default.md)           | Reads the default repeat mode set higher up.                                                                                               |
| [Loop](/engine/6000.7/script-reference/unityengine/wrapmode/loop.md)                 | When time reaches the end of the animation clip, time will continue at the beginning.                                                      |
| [Once](/engine/6000.7/script-reference/unityengine/wrapmode/once.md)                 | When time reaches the end of the animation clip, the clip will automatically stop playing and time will be reset to beginning of the clip. |
| [PingPong](/engine/6000.7/script-reference/unityengine/wrapmode/pingpong.md)         | When time reaches the end of the animation clip, time will ping pong back between beginning and end.                                       |
