How it works
Every Logic Node has outputs and inputs. A connection says "when this output fires, call that input". That's the whole system; everything else is detail.
Outputs and inputs
An output is something that happens to a node: a Trigger Volume's On Trigger Enter, a Timer's On Timeout, a Counter's On Goal Reached. Output names always start with "On".
An input is something a node can do when it's told to: a Move's Start, a Counter's Add, an Audio Clip's Play.
A connection joins one node's output to another node's input. You make connections on the node that sends, in the Logic I/O panel. One output can have as many connections as you like, and they run in the order they're listed. Many outputs can point at the same input.
A chain can be as long as you need. A Trigger can feed a Counter, the Counter a Relay, the Relay a Move, and the Move's On Move End an Audio Clip.
The four families
The 11 nodes come in four families. Each family has its own badge color and shape in the viewport, and its own wire color, so you can tell at a glance what a node does.
| Family | Badge | Nodes | Job |
|---|---|---|---|
| Triggers | Orange circle | Trigger Volume, Interact Zone | Notice the player |
| Movers | Blue hexagon | Move, Rotate | Move things in the level |
| Logic | Pink square | Auto, Relay, Counter, Timer, Branch | Decide, count, wait and pass signals on |
| Feedback | Yellow speech bubble | Audio Clip, Debug | Tell the player (or you) something happened |
Delays
There are two kinds of delay, and they add together:
- A connection's Delay (the Delay column in the Logic I/O panel) waits before calling that one target. Other connections on the same output aren't held up.
- A node's own Delay (the Delay setting on a Relay or Auto) waits before the node fires at all, so every connection on it waits.
So a Relay with a Delay of 1 s and a connection with a Delay of 0.5 s calls its target 1.5 s after it was triggered.
Delays are counted in physics ticks, so they come out the same at any frame rate: ten 0.05 s hops take 0.5 s whether the game runs at 30 or 144 FPS. Every delay pauses while the game is paused.
Once
Tick Once on a connection and it only ever sends one time. The rest of the node keeps working. Relays also have a Fire Once setting that stops the whole Relay after its first trigger. Both reset when the scene reloads.
The activator
Every signal carries an activator: whoever set the chain off. When the player walks into a Trigger Volume, the player is the activator, and it's passed along every connection after that. You'll see it in Trace output, and the Debug node can show it on screen with Show Activator. Auto has no activator, because nobody started it.
You don't have to do anything with the activator. It's there so you can tell, when debugging, which body set something off.
Turning nodes on and off
Every Logic Node has two shared inputs, Enable and Disable. A disabled node ignores every input and fires nothing until it's enabled again. Untick Start Enabled to have a node start the scene switched off.
Here the door's trigger does nothing until the player turns the generator on.
Settings every node has
| Setting | Default | What it does |
|---|---|---|
| Comment | empty | A note for other people working on the level. Has no effect on the game. |
| Start Enabled | on | If off, the node ignores everything until it receives Enable. |
| Trace | off | Prints every input and output of this node to the Output panel. See Trace. |
| Input | What it does |
|---|---|
| Enable | Turns the node on. |
| Disable | Turns the node off. It ignores inputs and fires nothing until enabled again. |
Connecting to built-in Godot nodes
Connections can also call ordinary Godot nodes, such as Play on an AnimationPlayer or AudioStreamPlayer3D, or Show and Hide on a mesh. Tick Show all nodes at the top of the Logic I/O panel to list every node as a target, not just Logic Nodes. The Target Input list then shows that node's actions: methods that take no required arguments and return nothing.
Built-in nodes are called without the activator, since they wouldn't know what to do with it.
What happens when the game runs
- Connections are stored in the scene file, so they're saved, versioned and reloaded like any other property.
- When the scene starts, each node connects its own rows. A row whose target or input no longer exists is skipped, with a warning in the Output panel naming the row.
- Nothing runs in the editor. Logic only happens while the game is playing.
- State isn't saved between play sessions: a Counter's count or a Branch's value goes back to its starting value whenever the scene loads.