# Rewind

> Rewinds all animations.

## Definition

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

## Rewind()

Rewinds all animations.

```csharp
public void Rewind()
```

### Remarks

Sets the time of all animations to 0.

Additional Resources: [\_time](/engine/6000.7/script-reference/unityengine/animationstate/time.md)

## Rewind(string)

Rewinds the animation named `name`.

```csharp
public void Rewind(string name)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the animation to rewind.

### Remarks

Sets the time of the animation named `name` to 0. If there is no animation named `name`, nothing happens.

Additional Resources: [\_time](/engine/6000.7/script-reference/unityengine/animationstate/time.md)

### Examples

```csharp
using UnityEngine;

[RequireComponent(typeof(Animation))]
public class AnimationRewindExample : MonoBehaviour
{
    public AnimationClip walkClip;

    Animation m_Animation;

    void Start()
    {
        m_Animation = GetComponent<Animation>();

        if (walkClip != null)
        {
            m_Animation.AddClip(walkClip, "Walk");
            m_Animation.Play("Walk");
        }
    }

    private void Update()
    {
        if (m_Animation.IsPlaying("Walk"))
        {
            // This printed value increases with each Update because the clip is playing.
            Debug.Log($"Walk state time: {m_Animation["Walk"].time}.");

            if (Input.GetKeyDown(KeyCode.R))
            {
                m_Animation.Rewind("Walk");
                // The new state time will be 0.
                Debug.Log($"Walk state time: {m_Animation["Walk"].time}.");
            }
        }
    }
}
```
