PoBDSDocs
简体中文v1.0.0
POBDS / 07

Variables and scope

Keep two practical scopes: one graph instance and one Actor’s shared data.

Current graph versus Actor global

Graph-local and Actor-global variable scopes. · Click to view full image
ScopeVisibilitySharing
Current graphThis Flow Graph or BDS instanceSeparate instances of one asset have independent values.
Actor globalThe Actor’s entire graph/BDS executionShared 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

  1. Choose scope

    Switch Current graph / Actor global on the left. The search field filters existing variables; it is not the add-variable field.

  2. Add a definition

    Choose a unique name, type and default. Use Actor for references and Int for precise millimeters or milliseconds.

  3. 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.

  4. 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.

Combine keywords with / · Enter opens first result · Esc closes