Motion
Get Motion

ReferenceScript nodesUtilities › Flow Control

Switch on Number

Goes the way of the case the number equals, or Default (from older graphs: use Switch on Integer).

Inputs

PinTypeStarts atNotes
inwhat happens next––
Selectionvaluenumber0–
Case 1 Valueanumber0–
Case 2 Valuebnumber1–
Case 3 Valuecnumber2–

Outputs

PinType
Case 1isAwhat happens next
Case 2isBwhat happens next
Case 3isCwhat happens next
Defaultotherwisewhat happens next

The code it becomes

The graph below written as a script would write it.

// On Scene Start{    const v = 0;    if (v === 0) {    } else if (v === 1) {    } else if (v === 2) {    } else {    }}

In a graph

The node with what starts it and Print to show what it gives, as Studio draws them.