Switch

From Augmotic Library
< Unreal‎ | API
Inputs
Selection Value to switch on.
Outputs
Value Branched execution pin that will be pulsed.
Special
Add Pin Adds an additional execution pin.

Overview

Switch will route the execution flow depending on the value of the Selection input. This allows a clean and efficient way to handle multiple values or states of an object. It can be an alternative to numerous booleans or comparisons.

Two primary node variants work similarly but differ in output value population.

Enumeration

Outputs of these nodes are automatically populated based on the enum type. There are many built-in enums, and you can create your own via the editor or a C++ header.

Int / String / Name

Outputs of these nodes begin with the Default pin, which can be removed if desired. During execution, the value of the Selection input is read; if a matching output does not exist, it will execute the Default pin.

The Add Pin button and Details panel can add and modify new pins and adjust other settings for the node.

The Integer Switch outputs must be consecutive but can offset the starting point.

Examples

Movement States

Movement input can be varied depending on the state of the player's character. The Idle state performs normal left/right movement while Sprinting reduces it. All other states will not receive input.