Blueprint switch case?

Hi,

how to do something like switch (a) case 1: case 2: case 3:

istead of if, if, if?

Thx.

L.

1 Like

Hey mate,

you just use a Switch node. It’s a bit different depending on the variable you want to use.

I used a String variable here:

http://puu.sh/c7T9o/22107e4c26.png

Here you can add the Strings you want to check to the Array in the lower left options window.

You can also do a switch on Int Values, but what i saw it’s only incrementing, so you say him “Start at 0”
and the switch node will give you 0, 1, 2, 3, 4 etc for every new Switch Case.

http://puu.sh/c7T9o/22107e4c26.png

hello, i will try it, thank you

it works, cool, dont know why i could not to find it

Hi,

Just starting to use this engine. This case select appears to be very limited in not allowing us to change the conditions; example integer increments by one only. What if I want to select a value of between 1000-2000?

If you select the node, you can select the start index in the details panel. You can’t change the step size though, afaik.

PS: Stupid, simple, but working workaround would be: Cast the Int to a String and use the Select node for Strings. There you can specify each entry.

You could just double click on the incremntInt Node and duplicated in the system macros and ad the value note to the input section the you will have a node which will increase and set a variable to a specific amount.