# RemoveState(IState)

> Removes a state from the state machine.

## Definition

* **Type:** Method
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.7/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor

```csharp
public void RemoveState(IState state)
```

### Parameters

**** (\[IState]\(/engine/6000.7/script-reference/unity/graphtoolkit/editor/istate)): The state to remove. Must belong to this state machine.

### Remarks

Removing a state also removes any transitions connected to it. Enclose this method with [StateMachine.UndoBeginRecordStateMachine](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachine/undobeginrecordstatemachine.md) and [StateMachine.UndoEndRecordStateMachine](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachine/undoendrecordstatemachine.md) to add this operation to the undo stack and to update the graph view with the changes.
