Skip to main content
Flow Core Documentation
Menu

Build a Working Result

Build Your First Flow

Make a Cube grow when Play Mode starts by combining a graph, process, Blackboard, Trigger, and Action.

Audience
New to Flow Core
Time
10–15 minutes
Requires
A writable Unity scene
Modules
Flow Core
On this page

Create a Cube that changes from scale (1, 1, 1) to (2, 2, 2) when Play Mode starts. This result exercises the complete Flow Core loop without requiring C#.

What you will build

flowchart LR T["Unity Start Trigger"] --> A["Action"] B["Local Blackboard: TargetScale"] --> A A --> R["Cube local scale changes"]
Image 01_03_01Screenshot production note

此处插图应该是教程最终结果的 Unity Game 或 Scene 视图对比截图;左侧显示 scale 为 1 的 Cube,右侧显示 Play Mode 中 scale 为 2 的 Cube,并标注 Before 与 After。

Watch the complete first-graph authoring loop, then use the written steps below as the exact configuration for this tutorial.

Video · 1:13Create Your First GraphSee the complete first-graph authoring loop before following the written steps.

Open video in a new tab

Create the scene owner

  1. Create a Cube and name it Growing Cube.
  2. Keep its Transform scale at (1, 1, 1).
  3. Add a FlowCoreProcess component.
  4. Add a Blackboard component to the same GameObject.

Keeping the process, Blackboard, and visible object together makes the first runtime ownership path easy to inspect.

Image 01_03_02Screenshot production note

此处插图应该是 Growing Cube 的 Unity Inspector 截图;保留 Transform、FlowCoreProcess 和 Blackboard 三个组件标题,并框选两个 Flow Core 组件。

Create and assign the graph

  1. In the Project window, use Create > Flow Core > Flow Graph.
  2. Name the asset GrowCubeFlow.
  3. Return to Growing Cube and assign GrowCubeFlow to its FlowCoreProcess.

The graph stores authored nodes and connections. Assigning it to the process creates the scene relationship that will build a runtime instance.

Add the typed value

  1. Open the Blackboard component’s Edit view.
  2. Add a Vector3 key named TargetScale.
  3. Set its value to (2, 2, 2).
  4. In FlowCoreProcess, add this Blackboard to Local Blackboards at index 0.
Image 01_03_03Screenshot production note

此处插图应该是 Blackboard Edit 视图与 FlowCoreProcess Local Blackboards 列表的组合截图;显示 Vector3 TargetScale 为 2,2,2,并框选 Local 索引 0 的绑定。

Add the Start Trigger

  1. Open GrowCubeFlow in the Flow Graph Editor.
  2. Set Debug Context to Growing Cube.
  3. Right-click the canvas and add a Trigger node.
  4. Set Bus to Unity.
  5. Set Unity Event to Start.

Unity will publish this lifecycle event after the process builds its runtime in Play Mode.

Add the scaling Action

  1. Add an Action node.
  2. Connect Trigger.Out to Action.In.
  3. Select the Action and add Set LocalScale from Transform/GameObject.
  4. Keep Instance resolved from Self and Scope set to Self.
  5. Configure Value to read from Blackboard.
  6. Select Local, index 0, key TargetScale.
Image 01_03_04Screenshot production note

此处插图应该是 Flow Graph Editor 中 Start Trigger 已连接到 Action 的截图;保留两个节点、连接线与 Action 指令列表,并框选 Set LocalScale。

Image 01_03_05Screenshot production note

此处插图应该是 Set LocalScale 指令展开后的编辑截图;显示 Instance 为 Self、Scope 为 Self、Value 来源为 Local Blackboard[0] 的 TargetScale,并框选这些关键字段。

Verify the result

  1. Save the scene and graph.
  2. Select Growing Cube and confirm its scale is (1, 1, 1) before Play Mode.
  3. Enter Play Mode.
  4. Confirm its Transform scale becomes (2, 2, 2).
  5. Exit Play Mode and confirm the authored Transform returns to (1, 1, 1).

Common Mistakes

SymptomCheck
The Cube does not changeConfirm GrowCubeFlow is assigned to FlowCoreProcess and the component is enabled.
The Trigger does not runConfirm the bus is Unity and the selected event is Start.
The Action does not runConfirm Trigger.Out is connected to Action.In.
Scale becomes the wrong valueConfirm TargetScale is a Vector3 at Local index 0.
The target cannot resolveKeep Instance and component Scope on Self for this tutorial.
Editor summaries are unresolvedSet Debug Context to Growing Cube.

What You Built

You authored behavior in a Flow Graph, gave that graph a scene runtime through FlowCoreProcess, stored configuration in a typed Blackboard, started a chain from a Unity Trigger, and used an Action to change a Unity component.

Change TargetScale to (1, 3, 1) and run the scene again. The visible result should change without editing graph topology.