"OR" in Unreal Blueprint?

Hey,

I’m currently learning blueprint in Unreal and have a question.

in C# i can write:

if (int x == 2 || int x == 10) { do something }

that means as much as “if x is 2 OR 10 do something”

Can i do this with Blueprints too? Or do i always have to branch, branch…?

And another question:
how can i make switch-case in Blueprints?

Right click in blueprint, type “or” , select or Boolean and connect the lines as needed.
Switch is similar, right click in blueprint, type “switch” , select what you need from flow control.

1 Like

@Felaixxx, thanks for posting on the forum!
These are all built-in Blueprint functions, both OR and Switch statements, you just have to add them to your graph by right-clicking to select the option. There is a pretty useful flow control piece in the docs as well so I’ll drop a link: Flow Control in Unreal Engine | Unreal Engine 5.0 Documentation
I hope all of this can help, and happy developing!
-Zen

1 Like

Better option would be to use a Math Expression.