# keepAnimatorStateOnDisable

> Controls the behaviour of the Animator component when a GameObject is inactive.

## Definition

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

```csharp
public bool keepAnimatorStateOnDisable { get; set; }
```

### Remarks

Set to true to keep the current state of the Animator controller.

Set to false to clear the current state of the Animator controller.

The default value is false.

**Note**: When this property is set to true, the Animator also preserves the animated values for inactive GameObjects. For example, a GameObject's transform is animated from x=0 to x=3 while it is active. After this GameObject becomes inactive, it still keeps the animated value x=3 instead of x=0.

This property is serializable and can be saved in a Prefab.

This property applies to the AnimatorController associated with the Animator.  This property does not affect [AnimatorControllerPlayable](/engine/6000.0/script-reference/unityengine/animations/animatorcontrollerplayable.md).
