State Machine Component Reference
Component options
The State Machine component owns the graph on a GameObject. Select the GameObject to inspect its startup and execution options. Use Start When Enabled for automatic startup, or control the component from code through the API.
The graph name and index identify a particular machine when a GameObject has several components. Match the intended component when sending events or referencing another machine. Update and evaluation settings control when the machine checks its graph; choose them alongside the scheduling advice in Performance.
For reusable graph content, assign a Subgraph. For authoring a new graph, follow Your First State Machine.
Settings reference
| Component or task | Setting | Default | Description |
|---|---|---|---|
| State Machine settings | Graph Name | "State Machine" | The name of the state machine. |
| Index | 0 | A user specified ID for the graph. | |
| Data | new StateMachineData() | The graph data. | |
| Authoring Layer | Default | The active prefab-safe authoring layer. Null for legacy inline data. | |
| Start When Enabled | true | Should the state machine start when the component is enabled? | |
| Pause When Disabled | false | Should the state machine pause when the tree is disabled? | |
| Update Mode | Every Frame | Specifies when the state machine should be updated. | |
| Evaluation Type | Entire Graph | Specifies how many states should be updated during a single tick. | |
| Max Evaluation Count | 1 | The maximum number of states that can run if the evaluation type is set to EvaluationType.Count. Constraint: Range(1, ushort.MaxValue). |
|
| Subgraph | Default | A reference to the subgraph. | |
| Options | — | Update Mode values: Every Frame, Manual. | |
| Options | — | Evaluation Type values: Entire Graph, Count. |