Is there a "IF BOOL1 = X AND BOOL2 = X THEN" node in blueprints?

Is there a “IF BOOL1 = X AND BOOL2 = X THEN” node in blueprints?

I’d like two variables to meet a condition and then return a TRUE bool but I cannot seem to find a node for .

For example:

If Jumping = True and Camera Locked = False then Return True.

I know you can Branch out the condition requirements but that seems a bit excessive.

In addition, could someone please explain how XOR and OR works with bools?

Thank you.

There is the ‘AND’ node:

But the “AND” node is what? If both bools are the same value? What if I wan’t to check If bool1 = false and bool2 = true, as in my example. Or, if Bool1 = true and Bool2 = true? Is there any indicator as if you want both values to be true or false? I couldn’t find the documentation with particular case.

Yes AND needs both bools to be true to evaluate as true on the branch node.

You can use OR if you want the Branch to return true if at least 1 of the bools is true

There are quite a few basic bool operations (as you have them in microcontrollers and stuff like that).

AND will return true if both are true. OR will return true if one of the inputs is true. XOR will return true if neither of the inputs is true or both are but not if only one of them is true and a few more.

If you want to check if one is true and one is false use a NOT node. That basically just switches the input from true to false and the other way around so you can use it for checks.

Here is a wikipedia article about it: Boolean algebra - Wikipedia

Cheers

EDIT: article is probably better to understand boolean arithmetic: http://www.allaboutcircuits.com/vol_4/chpt_7/2.html

Then use a NOT node inbetween the bool1 and the AND.
You could not find it in the documentation, because the documentation that EPIC has written for UE4 is basically non-existent.

Thank you for all the information. I definitely have enough to tackle any future bool encounters. Also, I am just learning of the XOR operation. I’ve never used it in my coding experience but that’s likely because I never knew it existed. Being self taught is rough on occasion; which makes me very thankful for your help!

It’s hard to imagine what kind of coding experience never took advantage of boolean operations, it’s about as basic and fundamental as it gets. Good luck for the future

Minecraft players have a really big advantage on subject. :cool:

What is funny, that is how I understand quite a bit of C++, I just try and reference it and attempt to recreate the situation I’m trying to fix/solve in Minecraft. It’s also how I design my maps…

Just the XOR operation specifically. I never did a lot of reading on bitwise operations either.

That only proves need of XOR :smiley:

XOR does it? :stuck_out_tongue: