Use Switch to switch Exec according to the input index. Switch is in the Control category.
|Enter||Exec||Execute this node|
|Index||Number||Controlling 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|
|0||Exec||Execute next node when index is 0|
|1||Exec||Execute next node when index is 1|
|2||Exec||Execute next node when index is 2|
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.
The default number of output ports is 3, click the “+” button at the bottom of the output right down corner to add more ports.