Variables and scope
Keep two practical scopes: one graph instance and one Actor’s shared data.
Current graph versus Actor global
| Scope | Visibility | Sharing |
|---|---|---|
| Current graph | This Flow Graph or BDS instance | Separate instances of one asset have independent values. |
| Actor global | The Actor’s entire graph/BDS execution | Shared within this Actor, not static storage shared by every Actor. |
Store CurrentEnemy in Actor global so acquisition, combat and defense can use it. Keep a temporary MoveResult local to its graph to avoid collisions with unrelated behaviors.
Create and use a variable
Choose scope
Switch Current graph / Actor global on the left. The search field filters existing variables; it is not the add-variable field.
Add a definition
Choose a unique name, type and default. Use Actor for references and Int for precise millimeters or milliseconds.
Read it
Use the variable to create a read node and wire it to a compatible input. Replacing a single-input connection keeps the previous source node.
Write it
Use a Set Variable Action or bind a function result to storage. Distinguish the initial definition from the current runtime value.
Actor references are values too
Store Self Actor, Target Actor or a method result in a local or Actor-global variable and pass it to child graphs. Connect that value to a property node’s Actor input instead of hard-coding Self in the inspector.
Editing during Play mode
Unlock editing and apply changes to the selected running AI. Runtime data and source configuration are separate. Save assets explicitly to preserve configuration; live references and temporary values are not automatically written back when Play mode ends.