Subgraph Reference
The Subgraph Reference state lets you plug a reusable Subgraph asset into your current state machine flow. Think of it like a reusable module slot: instead of rebuilding the same chunk of states/actions/conditions in multiple graphs, you put that logic in a Subgraph once and reference it where needed. Use Subgraph Reference when you want cleaner graphs and less duplication, especially for repeated behavior modules that appear in multiple state machines. It is most effective when paired with overrides, since the same subgraph can adapt to different contexts in the parent graph.

When the graph runs, Subgraph Reference acts as a structural entry point for the referenced subgraph content. Your gameplay logic still lives inside the referenced states (usually Action States), and transition conditions still control when flow moves between states.
A useful detail is how exits are handled: if a state inside the referenced subgraph reaches the end and has no outgoing transition, the flow can continue using the outgoing transitions configured on the Subgraph Reference node. This keeps the parent graph readable and gives you one clear place to define “what happens after this subgraph finishes.”
If you assign multiple subgraphs to the same Subgraph Reference, they are processed in list order, which makes it possible to chain reusable graph segments.
Overrides

Subgraph Reference supports Shared Variable Overrides, which is how the parent graph can customize subgraph behavior without editing the subgraph asset itself. Each override maps:
- Source: a variable defined in the subgraph.
- Override: the value/variable the parent should use instead.
In practice, this is what makes subgraphs truly reusable. You can use one subgraph asset in many places, but feed different values each time (different targets, speeds, timers, flags, etc.). If an override entry is left empty, the subgraph keeps its own default value for that variable.
Runtime Subgraph Selection and Override Refresh
For advanced setups, the selected subgraph can be changed at runtime (for example, selecting one of several subgraphs based on a variable).
After the selection changes, call:
StateMachine.ReevaluateSubgraphReferences()
This reevaluates Subgraph Reference nodes and rebuilds the injected subgraph content using the current selection and override mappings.