Skip to main content
Version: Next (dev)

Coroutines

Nodes for logic that spans more than one frame — waiting, sequencing, and running several things at once. For the concepts behind them, read Coroutines.

Any execution path that reaches one of these becomes a coroutine, and its entry point node shows a crossed-arrows icon.

Pausing​

Yield​

Pauses here and continues on the next frame.

Executionin, out
Everything elsenone

The simplest way to spread work across frames. Put one inside a long loop body so a single frame does not do all the iterations at once.

Starting and stopping​

StartCoroutine​

Starts a second execution path that runs independently of the one that launched it.

TitleStartCoroutine {Name}
Execution inunnamed
Execution outunnamed — continues immediately; CoroutineBody — the new path
Data inName — String
Data outCoroutineID — Coroutine
PropertyCoroutineMode — Stop Other, Don't Create New, Allow Overlap

The two execution outputs are the point of this node. The unnamed one continues straight away, while CoroutineBody runs separately and may take as long as it likes. Keep the CoroutineID if you want to stop it or wait for it later.

StopCoroutine​

TitleStopCoroutine {Name}
Executionin, out
Data inCoroutineID — Coroutine; Name — String

Stop by ID for something you started yourself, or by name to stop whatever is running under that name.

StopAllCoroutines​

Stops every coroutine belonging to this script. Execution pins only.

Worth calling in OnDeactivated if a script starts long-running work — otherwise a coroutine can outlive the thing that started it.

Waiting​

WaitForAll / WaitForAny​

Executionin, out
Data inone unnamed Coroutine pin per Count
PropertyCount — 1 to 16, default 1

Raise Count and the node grows an input pin for each coroutine to watch.

  • WaitForAll continues once every one of them has finished.
  • WaitForAny continues as soon as the first finishes — useful for racing a task against a timeout.

Coroutine modes​

Every entry point and StartCoroutine carries a Coroutine Mode, deciding what happens when a path is triggered while a previous run is still going:

ModeBehaviour
Stop OtherCancel the running one and start fresh. The default
Don't Create NewLet the existing run finish; ignore the new trigger
Allow OverlapRun both simultaneously

See Entry Points and Events for how to choose.

Coroutine nodes from the engine​

Alongside these built-ins, the engine provides ready-made coroutines that appear under the same Coroutines category. Each has Succeeded and Failed execution outputs:

NodeWhat it does
WaitPauses for a set duration
MoveToMoves an object to a position over time
TweenPropertyAnimates a property to a target value over time

These are the ones to reach for before writing a timing loop by hand.

See Also​