Watch the State Designer overview on YouTube.

State Designer is a visual finite state machine editor for Unity. Use it when gameplay is easiest to understand as distinct modes, such as Idle, Patrol, and Attack, with explicit transitions between them. This structure works well for gameplay flow, boss phases, animation control, and mode switching.

If finite state machines are new to you, start with What is a Finite State Machine? for an introduction to states, transitions, and conditions.

Build a state machine

Open Tools > Opsive > State Designer > Editor.

The State Designer window before a GameObject and state machine graph are selected.

The editor has four main areas:

The State Designer editor labeled with the graph, Element Inspector, operations toolbar, and debug toolbar.

  1. The graph is where you create and arrange states and transitions.
  2. The Element Inspector and Shared Variables panel are where you configure the selected element and reusable values.
  3. The operations toolbar selects and manages state machine graphs.
  4. The debug toolbar controls runtime inspection.

To create a graph, add a State Machine component by right-clicking the graph and selecting Add State Machine, or use the add button in the operations toolbar. Press Space or right-click the graph and select Create State to add the first state.

The Create State menu listing the state types available in State Designer.

Adding the first state also adds the Start event, which provides the entry point into the graph.

A new Idle state connected to the Start event in a State Designer graph.

Add Patrol and Log, then drag between their connection points to create transitions from Idle to Patrol, Patrol to Log, and Log back to Idle. Select a connection and press Delete if you need to remove it; drag a state to rearrange the graph.

Idle, an Action State containing Patrol, and a Log Action State form a cycle, with the Log-to-Idle return routed below the states.

Select a transition to configure its conditions in the Element Inspector. New transitions use State Finished by default. For this example, replace the Idle-to-Patrol condition with Timer and set the duration.

The Idle-to-Patrol transition uses All Conditions, Continuous evaluation and a Timer with Duration 1.

Select a state to rename it, add a comment, or edit its serialized fields. The Log state in this example exposes a Text field that can use either a direct value or a Shared Variable.

The Log Action State runs its Log Action in Sequence and uses the text State machine cycle complete.

Follow the state cycle

The Start event enters Idle. After the Timer duration, the state machine transitions to Patrol. Because Patrol does not finish on its own in this example, an Is Mouse Button Down condition moves it to Log. Log finishes its work, and the default State Finished condition returns the state machine to Idle.

Patrol-to-Log uses All Conditions, Continuous evaluation and IsMouseButtonDown set to the Left mouse button.

The resulting flow is Idle → Patrol → Log → Idle. Actions perform the work inside a state, while conditions decide when an outgoing transition is allowed to run. During Play mode, the editor shows the active state so you can follow this flow as it executes.

Editor controls and preferences

The State Designer operations toolbar with navigation, graph selection, Export, Find, and lock controls.

Use the operations toolbar to move backward or forward through recently opened graphs, choose a GameObject and one of its state machines, export the current graph as a Subgraph, search with Find, or lock the current graph while selecting other Unity objects.

Export copies the complete graph into a Subgraph asset without changing the source graph. To extract and replace a selected region, use Save as Subgraph as described on the Subgraphs page. The bottom status bar provides play, pause, and available step controls for runtime inspection; its error count opens the Error Window.

Choose the narrowest Shared Variable scope that needs the value: Graph for one graph, GameObject for state machines on one object, Scene for the current scene, or Project for the entire project. See Variable Scope for the differences.

Right-click empty graph space to use the following graph-level commands:

Command Result
Create State Opens the State selector at the pointer. Space performs the same action.
Create Group Creates an organizational group around the current selection when applicable.
Paste Pastes compatible graph elements from the clipboard.
Frame Selection / Frame All Fits the selected elements or complete graph in the window.
Focus > Selection Only / Connected Neighborhood / Off Dims unrelated elements without changing runtime behavior.
Add State Machine Adds another State Machine component to the selected GameObject.
Remove State Machine Removes the selected component after confirmation.

State and group commands are documented with States, Action-row commands with Actions, transition and Condition commands with Conditions, and Shared Variable row commands with Variables.

Use the Panels menu to show, hide, resize, or rearrange the Element Inspector and Shared Variables panel. Reset Layout restores the product layout when a panel is hidden or unusably small. Frame Selection, Frame All, Connected Neighborhood focus, zoom-aware readability, and the mouse-wheel preference control how the graph is presented without changing the asset.

Open Tools > Opsive > State Designer > Error Window, select the status-bar error count, or press Ctrl/Cmd+E. Selecting an error briefly identifies its State in the graph. A clean Error Window means that the editor found no known structural or field errors; it does not replace a Play Mode test.

Open Preferences > State Designer or Tools > Opsive > State Designer > Settings.

Preference What it controls
Show Hierarchy Icon Shows the State Designer indicator in Unity’s Hierarchy.
Check For Errors Runs editor validation and updates the status-bar error count.
Auto Save Prefab Saves prefab graph changes automatically. When off, use Ctrl/Cmd+S when prompted.
Keep Graph Selected Keeps the current graph when the next Unity selection has no state machine.
Panels Chooses the registered panels shown by default.
Mouse Wheel Scrolls Graph Uses the wheel to scroll rather than perform the normal graph zoom action.
Keep Selection On Graph Click Keeps selected elements when empty graph space is clicked.
Grid Line Spacing / Transparency Controls the editor grid interval and opacity.
Focus Mode Chooses the default focus view.
Zoom-aware Readability Hides secondary detail when zoomed far out.
Recent Entries Limits Recent entries in State, Action, and Condition selectors; 0 hides them.
Show Node Icon / Description / Debug Info Chooses the information rendered on State nodes.
Snap To Grid Aligns moved States to the editor grid.
Default Gizmos Color Sets the default Scene-view gizmo color.

These settings affect authoring and presentation rather than State, Action, or Condition logic unless the setting explicitly controls saving or serialization.

Open Unity’s Shortcut Manager or select Edit Bindings in the shortcut preferences to rebind these defaults:

Shortcut Action
Space Create State
Ctrl/Cmd+F Open Find
Ctrl/Cmd+Shift+F Focus the next Find result
Ctrl/Cmd+G Create a group from the selection
Ctrl/Cmd+Shift+G Remove selected groups without deleting their States
Home Focus the initial node
F / A Frame Selection / Frame All
Shift+F Toggle Connected Neighborhood focus
Ctrl/Cmd+0 Reset zoom
C Collapse or expand the selection
Enter Focus the Element Inspector
Arrow keys / Shift+Arrow keys Nudge by the normal or larger step
Ctrl/Cmd+E Open the Error Window
Esc Cancel the active operation or clear the applicable selection

Standard Cut, Copy, Paste, Duplicate, Delete, and Save shortcuts apply whenever the matching graph command is available. State Designer preferences are also available in the Unity Preferences window.

Related:

Configure the State Machine Component, adjust Editor Preferences, or continue with Getting Started.