Advanced Logic Patterns
Understand how Triggers and Chains execute, combine node and event timing, and support cutscenes, broadcasts, and hybrid boss logic.
For developers who know the basics and want to build correct, well-paced multi-step flows.Trigger branches start in priority order, and Chain steps run in sequence. When a flow contains both, consider each node's delay together with the schedule on the event it raises.
Core Mechanics: Trigger vs. Chainβ
In the Flow Graph, a connection is not just a line; it is a transfer of control. The type of the target node determines how that control is handled.
| Feature | π Trigger Node | π’ Chain Node |
|---|---|---|
| Execution Mode | Parallel (Fan-Out) | Serial (Sequence) |
| Blocking? | β Non-Blocking | β Blocking |
| Technical Impl. | Fire-and-Forget | Coroutine Yield |
| Data Flow | Passes data to all children instantly. | Passes data to the next child only after finishing. |
1. The Trigger Mechanism (Parallel)β
When the flow enters a Trigger Node:
- The system calculates the Priority of all connected Triggers.
- It executes them one by one in a loop.
- Crucially, it does not wait for a Trigger to finish its tasks before starting the next one.
- Result: To the player, all effects (Sound, UI, Particles) appear to happen simultaneously in the same frame.
2. The Chain Mechanism (Sequential)β
The Chain Node has a complex lifecycle designed for pacing. It holds the flow using Two Layers of Delay:
- Pre-Execution: Waits for
Start Delay. - Execution: Raises the event.
- Post-Execution: Waits for
Duration, then waits one additional frame ifWait For Completionis enabled. - Signal: Only then does it fire the Next Node.
The Timeline of Executionβ
Understanding how Node Configuration (Graph) interacts with Event Configuration (Inspector) is essential here.
The "Double Delay" Ruleβ
If you configure a delay on the Node AND a delay on the Event, they are Additive.
Total Time to Action = Node Start Delay + Event Action Delay
Visual Timelineβ
Here is the millisecond-by-millisecond breakdown of a single Chain Node execution:
[Flow Enters Node]
β
βββ 1. Node Condition Check (Graph Layer)
β π If False: STOP.
β
βββ 2. Node Start Delay (Graph Layer) β±οΈ
β β³ Waiting...
β
βββ 3. Event Raised (Core Layer) π
β β
β βββ a. Event Condition Check (Inspector Layer)
β β π If False: Skip Actions (But flow continues!)
β β
β βββ b. Event Action Delay (Inspector Layer) β±οΈ
β β β³ Waiting...
β β
β βββ c. UnityActions Invoke (Game Logic) π¬
β (e.g., Play Animation, Subtract Health)
β
βββ 4. Node Duration / Wait (Graph Layer) β³
β π Flow is BLOCKED here.
β (Waits for Duration seconds, then one frame if enabled)
β
βββ 5. Signal Next Node βοΈ
- Event Conditions only stop the local side effects (Action c). They DO NOT stop the Flow Graph from proceeding to step 4 and 5.
- To stop the Flow Graph logic, you must use Node Conditions (Step 1).
Cookbook: Real-World Design Patternsβ
1. The "Cinematic" Pattern (Cutscene)β
Goal: A strictly timed sequence of events. Scenario: Camera moves -> Door opens -> Character walks in -> Dialog starts.

- Structure: Root β Chain β Chain β Chain.
- Configuration:
- Use Chain Nodes (π’) for every step.
- Use Node Duration (β³) to pace the sequence.
- Example: If "Door Open Anim" takes 2.0s, set the Node Duration to 2.0 to ensure the character doesn't walk through a closed door.
2. The "Broadcaster" Pattern (Player Death)β
Goal: One state change triggering multiple independent systems. Scenario: Player dies. You need to: Play Sound, Show Game Over UI, Spawn Ragdoll, Save Game.

- Structure: Root β Multiple Triggers.
- Configuration:
- Root: OnPlayerDeath.
- Children: 4 separate Trigger Nodes (π ).
- Why: If the "Save Game" system hangs or errors out, you don't want it to block the "Game Over UI" from appearing. Each Trigger branch can use its own condition and delay.
3. The "Hybrid Boss" Pattern (Complex State)β
Goal: Complex AI phase transition. Scenario: Boss enters Phase 2. He roars (animation), AND SIMULTANEOUSLY the music changes and the arena turns red. WHEN the roar finishes, he starts attacking.

- Structure:
- Root (OnHealthThreshold).
- Chain Node (BossRoarAnim) with Duration set to the animation length.
- Trigger Node (MusicChange) attached to the Root (Parallel to Roar).
- Trigger Node (ArenaColorChange) attached to the Root (Parallel to Roar).
- Chain Node (StartAttack) attached to the BossRoarAnim node.
- Flow:
- Music and Color happen immediately alongside the Roar.
- The StartAttack starts after the Roar node's configured duration (Step 4 in Timeline).
Summary: When to use what?β
| Requirement | Use Node Type | Why? |
|---|---|---|
| "Do X, then do Y" | Chain (π’) | Guarantees order via blocking. |
| "Do X, Y, and Z all at once" | Trigger (π ) | Fire-and-forget. Parallel execution. |
| "If HP < 0, do X" | Node Condition | Stops the flow logic entirely. |
| "Only play sound if not muted" | Event Condition | Stops the side effect, keeps flow logic running. |
| "Wait before doing X" | Node Start Delay | Delays the event raise. |
| "Wait after X before doing Y" | Node Duration | (Chain Only) Delays the next node signal. |