Embedded Mode
Use scene references directly in your state machines
Embedded Mode allows you to create state machines that are stored directly on a Runner component, enabling direct references to scene objects.
What is Embedded Mode?
By default, State Machine assets are stored in the Project folder and shared across all runners that reference them. This is great for reusable logic, but it means you cannot reference scene-specific GameObjects.
Embedded Mode solves this by storing the state machine graph directly on the Runner component, allowing:
Direct references to scene GameObjects
Unique behavior per Runner instance
Scene-specific configurations
When to Use Embedded Mode
Reusable AI behavior
Asset Mode
Scene-specific interactions
Embedded Mode
Shared game logic
Asset Mode
One-off sequences
Embedded Mode
Prefab behavior
Asset Mode
Level-specific events
Embedded Mode
Prefabs do not support Embedded Mode. If you need prefab support, use Asset Mode with Runner Variables for instance-specific data.
Creating an Embedded State Machine
Add a State Machine Runner component to a GameObject
In the Inspector, click Create Embedded
The Graph Editor opens with a new embedded graph
Design your state machine as usual
Using Scene References
With Embedded Mode, you can drag scene objects directly into node properties:
Select a node that needs a GameObject reference
Drag a GameObject from the Hierarchy to the property field
The scene reference is stored in the embedded graph
Example: Door Controller
Opening an Embedded Graph
Click Open Graph on the State Machine Runner component
Or double-click the Runner component
The Graph Editor title shows "(Embedded)" to indicate you're editing an embedded graph.
Converting Between Modes
Asset โ Embedded
With a Runner that has an Asset assigned
Click Convert to Embedded (if available)
The asset is copied to an embedded graph
Converting to embedded creates a copy. Changes to the original asset won't affect the embedded version.
Embedded โ Asset
Open the embedded graph
Use File โ Export as Asset
Choose a location in your Project
Assign the new asset to the Runner
Last updated
Was this helpful?