# RemoveStateMachine(AnimatorStateMachine)

> Utility function to remove a state machine from its parent state machine.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Animations](/engine/6000.3/script-reference/unityeditor/animations.md)
* **Assembly:** UnityEditor

```csharp
public void RemoveStateMachine(AnimatorStateMachine stateMachine)
```

### Parameters

**** (\[AnimatorStateMachine]\(/engine/6000.3/script-reference/unityeditor/animations/animatorstatemachine)): The state machine to remove.

### Remarks

If the state machine is a sub asset of the parent state machine, it will be deleted. This function pushes an Undo operation.
