World Utilities / Converters

Boolean Operation

Combines one or two boolean values using NOT, AND, OR, XOR, NAND, NOR or XNOR.

since v0.3.0localsynchronizedpersisted
Component Add Component menu / prefab Source
Boolean Operation ConverterVRCTools.World.Values.Converters.BooleanOperationConverter Values › Converters › Boolean Operation Converterprefab: Boolean Operation.prefab BooleanOperationConverter.cs ↗

Evaluates a logical operation on two inputs A and B and writes the result into a target boolean whenever either input changes.

Operations

Operation Result true when …
NOT !A A is false (B is ignored)
AND A && B both are true
OR A \|\| B at least one is true
XOR A ^ B exactly one is true
NAND !(A && B) not both are true
NOR !(A \|\| B) both are false
XNOR !(A ^ B) both are equal

In v0.7.0 NAND is evaluated like NOR (true only when both inputs are false). Until this is fixed, build a NAND from an AND converter followed by a NOT converter.

Parameters

Section Parameter Default Description
Target Type LOCAL Kind of the target value.
  Target None Boolean value receiving the result. Required.
  Operation NOT The operation to evaluate.
A Type STATIC Where input A is read from: STATIC, LOCAL or SYNCHRONIZED.
  Component false The constant (static) or value to read A from.
B Type STATIC Where input B is read from.
  Component false The constant (static) or value to read B from.

Usage

See Owner-controlled features for a complete example that lets the instance owner disable a feature globally while players can still opt out individually.

NOT is handy on its own: invert a boolean once and use the result in several places instead of ticking Invert on every applicator.