Hey everyone.
I put this short tutorial together after I couldn’t find one on the forums. I’ve noticed in the past that some users, especially beginners, don’t have a full understanding of how the various Boolean nodes operate within Blueprints.
To put it simply, a Boolean is a logic gate whose output can be one of two states - true or false. Below are types of Boolean’s available in Blueprints.
You’ll see that they have two inputs, but remember that Boolean’s can contain a number of inputs to cater for your project’s needs. This can be achieved by clicking ‘add pin’ on the Boolean node (this only applies to AND, OR and NAND gates within Blueprints).
How each one operates can be seen in the following tables where 0 = FALSE and 1 = TRUE. OP = Output.
AND
The AND gate will output TRUE when all inputs are TRUE.
[table=“width: 100, class: grid, align: left”]
**A**
**B**
**OP**
0
0
0
0
1
0
1
0
0
1
1
1
OR
The OR gate will output TRUE when any one or all inputs are TRUE.
[table=“width: 100, class: grid, align: left”]
**A**
**B**
**OP**
0
0
0
0
1
1
1
0
1
1
1
1
NOT
The NOT gate acts as an inverter. Whatever the input, the inverse is output.
[table=“width: 80, class: grid”]
**IP**
**OP**
0
1
11
0
NAND
The NAND gate is a combination of the AND and NOT gates. This will output the inverse results of the AND gate.
[table=“width: 100, class: grid, align: left”]
**A**
**B**
**OP**
0
0
1
0
1
1
1
0
1
1
1
0
NOR
The NOR gate is a combination of the OR and NOT gates. This will output the inverse results of the OR gate.
[table=“width: 100, class: grid, align: left”]
**A**
**B**
**OP**
0
0
1
0
1
0
1
0
0
1
1
0
XOR
The XOR (known as exclusive OR) gate will output TRUE when either one of the inputs is TRUE but not when both are TRUE.
[table=“width: 100, class: grid, align: left”]
**A**
**B**
**OP**
0
0
0
0
1
1
1
0
1
1
1
0
XNOR (not available in Blueprints)
The XNOR (known as exclusive NOR) gate is a combination of the XOR and NOT gates. This will output the inverse results of the XOR gate.
[table=“width: 100, class: grid, align: left”]
**A**
**B**
**OP**
0
0
1
0
1
0
1
0
0
1
1
1
Examples
AND Gate
The player needs multiple keys to open a door or to activate something.
Has KEY 1 > No KEY 2 > Door remains locked
Has KEY 1 > Has KEY 2 > Able to open door
OR Gate
Throughout a level the player has to find and lead NPC’s to a safe zone. To succeed they need at least one survivor. If they bring more, the same success is met.
Combination
The player found and led all the NPC’s to the safe zone. They met the requirements of leading at least one but now that they have them all, they get rewarded with a bonus. This can be achieved by simply using an AND Boolean after the OR criteria was met.
The ‘reward player’ event could also be plugged into the second branch’s ‘false’ output.
Thanks for reading and if anyone has any comments or suggestions please leave them below!
Rob.