# LoadStateMachine<T>(string)

> Loads a StateMachine of type T from the asset at the specified path.

## Definition

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

```csharp
public static T LoadStateMachine<T>(string assetPath) where T : StateMachine
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The relative path to the state machine asset.

### Returns

| Type | Description                                                                         |
| ---- | ----------------------------------------------------------------------------------- |
| T    | The loaded state machine instance, or `null` if no matching state machine is found. |

### Remarks

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