Nodes

All the node types available in State Machine 2

State Machine 2 provides a variety of node types to build any game logic you can imagine.

Node Types Overview

Node
Icon
Purpose

๐ŸŸข Start

Entry point

Begins state machine execution

โšก Actions

Execute tasks

Runs Game Creator 2 actions

๐Ÿ”€ Branch

Decision

Multiple conditional paths

โ“ Conditions

Evaluate

Check conditions before proceeding

๐ŸŽฏ Trigger

Events

React to game events

๐Ÿ“ฆ Sub-State Machine

Modular

Embed another state machine

๐Ÿšช Exit

Terminate

End execution with callbacks

โžก๏ธ Relay

Organization

Visual routing (no logic)


๐ŸŸข Start Node

The Start Node is the entry point of your state machine. Execution begins here when the runner starts.

Start Node

Features

  • Automatically created when you create a new state machine

  • Cannot be manually created or deleted

  • Can include initial actions

  • Only has output ports (no inputs)

Connections

Port
Direction
Connects To

Output

โ†’

Actions, Branch, Conditions, Sub-State Machine, Exit

The Start node executes immediately when the State Machine Runner starts. Connect it to your initial behavior.


โšก Actions Node

The Actions Node executes one or more Game Creator 2 actions in sequence.

Features

  • Add unlimited actions

  • Actions execute in order (top to bottom)

  • Supports async actions (waits for completion)

  • Can be triggered by any node type

Connections

Port
Direction
Connects To

Input

โ†

Start, Actions, Branch, Conditions, Trigger, Sub-State Machine

Output

โ†’

Any node

Use Cases

  • Play animations or sounds

  • Modify variables

  • Control characters

  • Spawn objects

  • Any Game Creator 2 action


๐Ÿ”€ Branch Node

The Branch Node creates multiple conditional paths, similar to a switch statement.

Features

  • Add multiple branches with conditions

  • Each branch has its own conditions and actions

  • First matching branch executes

  • Default output if no conditions match

Connections

Port
Direction
Connects To

Input

โ†

Any node

True Outputs

โ†’

Per-branch outputs

Default Output

โ†’

Fallback when no conditions match

Example


โ“ Conditions Node

The Conditions Node evaluates conditions and routes execution based on the result.

Features

  • Add multiple conditions (AND logic)

  • Two outputs: True and False

  • Can be triggered by other nodes or triggers

Connections

Port
Direction
Connects To

Input

โ†

Any node

Trigger Input

โ†‘

Trigger nodes only

True Output

โ†’

When all conditions pass

False Output

โ†’

When any condition fails

Use Cases

  • Check player state before actions

  • Validate game conditions

  • Gate progression


๐ŸŽฏ Trigger Node

The Trigger Node reacts to Game Creator 2 events and triggers, providing event-driven execution.

Features

  • Use any GC2 trigger type

  • Event-driven (waits for trigger)

  • Self-contained entry point

  • Works with collision, input, timers, and more

Connections

Port
Direction
Connects To

Output

โ†’

Actions, Branch, Conditions, Sub-State Machine

Condition Output

โ†“

Directly to Conditions nodes

Common Triggers

Trigger
Description

On Start

When runner begins

On Update

Every frame

On Trigger Enter

Collision detection

On Input

Player input

On Timer

Timed events

On Variable Change

React to data changes


๐Ÿ“ฆ Sub-State Machine Node

The Sub-State Machine Node embeds another state machine, enabling modular and reusable design.

Features

  • Reference any State Machine asset

  • Nested execution

  • Exit nodes in the sub-machine connect to this node's outputs

  • Perfect for reusable behavior modules

Connections

Port
Direction
Connects To

Input

โ†

Any node

Output

โ†’

Triggered by Exit nodes in the sub-machine

Use Cases

  • Reusable AI behaviors (Patrol, Combat, Flee)

  • Game mode management (Menu, Playing, Paused)

  • Complex sequences (Cutscenes, Tutorials)

Creating Sub-State Machines

  1. Drag a State Machine asset into the graph

  2. Or right-click โ†’ Create Node โ†’ Sub-State Machine

  3. Assign the state machine asset in the Inspector

Tip: Drag and drop a State Machine asset from the Project window directly onto the graph to instantly create a Sub-State Machine node.


๐Ÿšช Exit Node

The Exit Node terminates state machine execution and can trigger callbacks.

Features

  • Automatically created when you create a new state machine

  • Cannot be manually created or deleted

  • Clean termination point

  • Triggers parent Sub-State Machine outputs

  • Useful for signaling completion

Connections

Port
Direction
Connects To

Input

โ†

Any node

(No outputs)

โ€”

Terminates execution

Use Cases

  • End a sub-state machine and continue parent flow

  • Signal completion of a behavior

  • Clean shutdown with callbacks


โžก๏ธ Relay Node

The Relay Node is for visual organization only โ€” it doesn't execute any logic.

Features

  • Route connections for cleaner graphs

  • No execution overhead

  • Purely visual organization

Connections

Port
Direction
Connects To

Input

โ†

Any node

Output

โ†’

Any node

Use Cases

  • Organize complex connection paths

  • Improve graph readability

  • Route around node clusters


See Also

Last updated

Was this helpful?