# ResetControllerState(bool)

> Resets the AnimatorController to its default state.

## Definition

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

```csharp
public void ResetControllerState(bool resetParameters = true)
```

### Parameters

**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Set to true to also reset the controller parameters to their default values. When set to false, only the controller state is reset.

### Remarks

Use this method to reset the layers in the [AnimatorController](/engine/6000.5/script-reference/unityeditor/animations/animatorcontroller.md) to their default state.

### Examples

```csharp
using UnityEngine;

// Press the Spacebar in Play Mode to reset the animator to the default state

[RequireComponent(typeof(Animator))]
public class AnimatorResetExample : MonoBehaviour
{
    // The Animator component on the GameObject this script is attached to.
    Animator m_Animator;

    void Start()
    {
        m_Animator = GetComponent<Animator>();
    }

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            //This will reset the animator to the default state.
            m_Animator.ResetControllerState();
        }
    }
}
```
