Logic

Perform AND, OR, XOR, NOT, NAND, and NOR logic on booleans.

What it does

Logic combines inputs A and B with a boolean operation: AND, OR, XOR, NAND, NOR or NOT. An input that is not already true/false is converted: a number counts as true above 0.5 and false otherwise, including negative numbers. NOT inverts A alone and ignores B.

When to use it

ParameterTypeDefault
aOneOf([Boolean, Number])
bOneOf([Boolean, Number])
operationString"AND"

Gotchas

Numbers plug straight in, with no separate compare step for a simple threshold.

NOT reads A only. B is still shown as an input and is ignored when the operation is NOT, so leave it unwired.

Anything that is not a boolean or a number reads as false. A colour, image or other non-numeric value wired in by mistake is treated as false rather than raising an error.

Worked example

  1. Add a Logic node and set Operation to AND.

  2. Wire two Compare results into A and B to test two conditions at once.

  3. Feed the result into a Conditional node to choose between two values based on the combined test.

  4. Switch Operation to NOT and use only A for the opposite of a single condition.

See also

Compare · Table · Conditional · Filter