# CreateStateMachine<T>(string)

> Creates a new state machine asset of type T at the specified file path.

## Definition

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

```csharp
public static T CreateStateMachine<T>(string assetPath) where T : StateMachine, new()
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The relative path for the new asset (e.g., "Assets/Graphs/MyStateMachine.mystatemachine").

### Returns

| Type | Description                         |
| ---- | ----------------------------------- |
| T    | The created state machine instance. |

### Remarks

This is the [StateMachine](/engine/6000.7/script-reference/unity/graphtoolkit/editor/statemachine.md) counterpart of [GraphDatabase.CreateGraph](/engine/6000.7/script-reference/unity/graphtoolkit/editor/graphdatabase/creategraph.md).
