Skip to main content
Flow Core Documentation
Menu

Graph Authoring

Graph Assets & FlowCoreProcess

Separate reusable graph authoring from per-object runtime ownership.

Audience
All developers
Time
7 minutes
Requires
A Flow Graph and a scene GameObject
Modules
Flow Core
On this page

Use a Flow Graph asset to author reusable behavior and FlowCoreProcess to run one instance of that behavior on a GameObject. Keeping these responsibilities separate prevents scene state from leaking into shared assets.

The ownership boundary

LayerOwnsDoes not own
Flow Graph assetSerialized nodes, ports, connections, comments, and settingsPer-object active chains or scene values
FlowCoreProcessGraph assignment, runtime lifecycle, Local Blackboard bindings, and public entry callsShared authored graph topology
Runtime instanceExecutable nodes, active chains, payload, and current execution stateProject authoring data

A graph can be assigned to several processes. Each process builds its own runtime, so one enemy can wait while another enemy using the same graph is already attacking.

Bind a graph to a scene object

  1. Create or select the GameObject that should own the behavior.
  2. Add FlowCoreProcess.
  3. Assign a Flow Graph.
  4. Bind any Local Blackboards the graph expects.
  5. Open the graph and set Debug Context to this GameObject.
  6. Enter Play Mode and activate one visible Trigger or Entry path.
Image 02_02_01Screenshot production note

此处插图应该是两个不同 GameObject 分别引用同一个 Flow Graph 的 Inspector 对比截图;保留各自 FlowCoreProcess 和不同 Local Blackboard 绑定,并用连线标注共享 Graph、独立运行时。

Reuse without sharing state

Put data that varies by object in a Local Blackboard or another explicit runtime source. Avoid changing graph topology at runtime to represent object state. A shared graph should describe the stable behavior, while each process supplies its own context.

Good per-object values include target, health threshold, movement speed, and current mode. Good graph-level authoring includes the sequence, branch structure, node configuration, and supported module layout.

Runtime rebuilds

Use normal scene initialization for ordinary authoring. Runtime rebuild APIs are integration tools:

  • Rebuild the runtime after intentionally replacing the graph source. Active chains are not preserved across that boundary.
  • Rebuild Blackboard bindings after intentionally changing process Blackboard lists.
  • Batch list edits, then rebuild once instead of rebuilding after every change.

Observable behavior

The binding is correct when:

  • the Inspector shows the intended graph on the intended object;
  • Local Blackboard indices match graph value paths;
  • Debug Context can resolve summaries for that object;
  • Play Mode shows the expected chain on that process only.

Common misunderstandings

  • Editing a shared graph changes authored behavior for every object that uses it.
  • Editing one object’s Blackboard does not change another object’s Local Blackboard.
  • Debug Context chooses an editor inspection target; it does not transfer runtime ownership.
  • A graph asset in the Project window has no Unity lifecycle until a runtime owner builds it.