Skip to main content
TikTok Effect House Platform Logo
Download
Log Masuk
Control

Switch

Use Switch to switch Exec according to the input index. Switch is in the Control category.

Input

NameData typeDescription
EnterExecExecute this node
IndexNumberControlling which item to be selected, it will be rounded to 0, 1, 2 etc. For example, if the input is 1.4, it will be recognized 1, if it is 1.5, it will be 2, so on and so forth

Output

NameData typeDescription
0ExecExecute next node when index is 0
1ExecExecute next node when index is 1
2ExecExecute next node when index is 2

Example

In this example, it demonstrates the effect that when tapping the screen it will randomize an icon on the screen. The logic is we generate a random number, and each number will correspond to a texture for the 2d image. When you tap on the screen, it will trigger the switch happening.

Tip
Tip

The default number of output ports is 3, click the “+” button at the bottom of the output right down corner to add more ports.