Summary
Boolean NAND node appears broken in blueprints in all versions of Unreal Engine 4, UE5, and UEFN (presumably even predating 2017)
2017 FORUM POST: Bug: NAND gate inaccurate if more than 2 inputs
2024 FORUM POST: Is NAND gate bugged?
Steps to Reproduce
- In any blueprint, create a node for a boolean NAND operation.
- Click ‘add pin’ to add a third input to the node.
- Checkmark two of the three inputs and leave one of three inputs UNCHECKED.
- Observe how the NAND node will output FALSE (which is erroneous)
Expected Result
In the field of digital logic, a NAND gate is, quite simply:
an AND gate with a trailing NOT gate hooked to its output.
Therefore, the only instance in which a NAND operation should output ‘false’ is when ALL of its inputs are set to true:
NAND (F, F, F) = true
NAND (F, F, T) = true
NAND (F, T, F) = true
NAND (F, T, T) = true
NAND (T, F, F) = true
NAND (T, F, T) = true
NAND (T, T, F) = true
NAND (T, T, T) = FALSE
(You can see the above behavior by hooking up a boolean ‘NOT’ node to the output of a 3-input boolean ‘AND’ node.)
Observed Result
NAND (F, F, F) = true
NAND (F, F, T) = FALSE (erroneous)
NAND (F, T, F) = true
NAND (F, T, T) = FALSE (erroneous)
NAND (T, F, F) = true
NAND (T, F, T) = FALSE (erroneous)
NAND (T, T, F) = true
NAND (T, T, T) = TRUE (erroneous)
Platform(s)
Reproduced in Unreal Engine 5.3.2,
but presumed to affect all versions of Unreal Engine 5, Unreal Engine 4, and UEFN.