Sequence (Sequential Execution)
Sequence takes one execution signal and runs its connected outputs from top to bottom—Then 0, Then 1, Then 2, and so on—within the same frame.
Category: Flow Control
Level: Beginner
K2Node_ExecutionSequence
YouTube Video Lesson (#02)
Interactive Blueprint Graph & Copyable Code
Select "Copy Nodes" to copy the graph below to your clipboard:
Pin Reference
Execution order shown in the video:
- Start:
Score = 5is assigned, thenSequenceis triggered. - Then 0 (IncrementInt): Score is incremented by 1 (Score = 6).
- Then 1 (Add): Score is increased by 10 and assigned (Score = 16).
- Then 2 (Subtract):
TargetScore - Scoreis evaluated and assigned back to Score. - Then 3 (PrintString): The final Score value is converted with
Conv_IntToStringand printed.
| Pin Name | Direction | Data Type | Description |
|---|---|---|---|
| (Exec In) | Input | Exec (White) | The execution signal that starts the entire chain. |
| Then 0 | Output | Exec (White) | The first execution output. Its synchronous chain finishes before the next output runs. |
| Then 1...N | Output | Exec (White) | Outputs triggered in order after the previous output's synchronous chain has finished. |
Use Cases
Sequence is useful when several independent operations must run in a clear order:
- Multiple Data Initialization: Assign health, score, and inventory data synchronously at startup.
- Actor Setup: Configure a spawned actor's components, references, and physics settings in order.
- Graph Organization: Split long node chains into clean, top-to-bottom blocks.
- User Interface: Bind data and trigger animations immediately after creating the UI.
Common Mistakes
- Latent Operations: Sequence does not wait for Delay nodes. Later outputs run immediately after the synchronous path returns. Use a Timer or Timeline when timing matters.
- Data Dependencies: Be explicit when one output writes a value that a later output reads in the same frame.
- Unnecessary Outputs: Avoid Sequence when the operations do not need explicit ordering.