# Boolean

These nodes work with **true/false** values — the yes/no answers your scene produces, such as whether a door is open, a switch is on, or a trainee is standing in the right place. An operator takes one or two of these true/false values and works out a new one, so you can combine several conditions into a single answer and react to it.

## What's on this page

- **And Operation** — the answer is true only when *both* values are true.
- **Or Operation** — the answer is true when *at least one* value is true.
- **Not Operation** — flips a single value to its opposite.

The **And** and **Or** nodes hand you the answer in two ways at once: a true/false **Result** you can read whenever you like, and two triggers — **OnTrue** and **OnFalse** — that fire at the moment the answer changes. Use whichever suits your scene.

---

## True / false logic

### And Operation

Checks two true/false values and tells you whether *both* of them are true.

#### What it does

This node looks at two true/false values you feed in and combines them: the result is true only when **both** are true. If either one is false — or both are — the result is false. Think of it as the word “and” in everyday speech: the door is unlocked *and* the trainee is wearing a helmet.

The node keeps watching both inputs and updates as they change. The **Result** output always holds the current answer, ready to read at any time. The two trigger outputs fire only at the moment the answer flips: **OnTrue** fires the instant the combined answer becomes true, and **OnFalse** fires the instant it becomes false. If an input changes but the overall answer stays the same, neither trigger fires.

#### Inputs

<table id="bkmrk-port-type-what-to-co"><thead><tr><th style="white-space: nowrap;">Port</th><th style="white-space: nowrap;">Type</th><th>What to connect</th></tr></thead><tbody><tr><td style="white-space: nowrap;">**Boolean A**</td><td style="white-space: nowrap;">True / false</td><td>The first true/false value you want to check — for example, whether a switch is on.</td></tr><tr><td style="white-space: nowrap;">**Boolean B**</td><td style="white-space: nowrap;">True / false</td><td>The second true/false value to check alongside the first — for example, whether a safety guard is closed. Both must be true for the result to be true.</td></tr></tbody></table>

#### Outputs

<table id="bkmrk-port-type-what-you-g"><thead><tr><th style="white-space: nowrap;">Port</th><th style="white-space: nowrap;">Type</th><th>What you get</th></tr></thead><tbody><tr><td style="white-space: nowrap;">**OnTrue**</td><td style="white-space: nowrap;">Trigger</td><td>Fires once at the moment both values become true. Wire this to whatever should happen when the combined answer turns true.</td></tr><tr><td style="white-space: nowrap;">**OnFalse**</td><td style="white-space: nowrap;">Trigger</td><td>Fires once at the moment the answer turns false — that is, when at least one of the two values stops being true. Wire this to whatever should happen when the combined answer turns false.</td></tr><tr><td style="white-space: nowrap;">**Result**</td><td style="white-space: nowrap;">True / false</td><td>The current combined answer: true when both values are true, otherwise false. You can read this at any time.</td></tr></tbody></table>

#### Example

<table id="bkmrk-boolean-a-input-mach"><tbody><tr><td style="white-space: nowrap;">**Boolean A** input</td><td>Machine power is on — `true`</td></tr><tr><td style="white-space: nowrap;">**Boolean B** input</td><td>Safety guard starts open (`false`), then the trainee closes it (`true`)</td></tr><tr><td style="white-space: nowrap;">**OnTrue** output</td><td>Fires the instant the guard closes — now both are true, so the answer flips to true and this trigger fires once (you could use it to start the machine)</td></tr><tr><td style="white-space: nowrap;">**Result** output</td><td>`true`</td></tr></tbody></table>

#### Tips

- Use the **Result** output when you just need the current answer somewhere else; use **OnTrue** / **OnFalse** when you want something to happen the moment the answer changes.
- The triggers fire only on a change. If both values are already true when your scene starts, **OnTrue** won’t fire until the answer leaves and returns to true.
- Need to check that *either* value is true instead of both? Use the **Or Operation** node. Need to flip a single true/false value? Use the **Not Operation** node.

### Or Operation

Checks two true/false values and tells you whether at least one of them is true.

#### What it does

This node looks at its two true/false inputs and works out a single combined answer. The combined answer is **true** whenever at least one of the inputs is true, and only becomes **false** when both inputs are false. You can read this answer at any time from the Result output.

The node keeps watching both inputs and re-checks the answer whenever either one changes. The moment the combined answer flips to true, the **OnTrue** trigger fires once; the moment it flips back to false, the **OnFalse** trigger fires once. If an input changes but the overall answer stays the same, neither trigger fires.

#### Inputs

<table id="bkmrk-port-type-what-to-co-0"><thead><tr><th style="white-space: nowrap;">Port</th><th style="white-space: nowrap;">Type</th><th>What to connect</th></tr></thead><tbody><tr><td style="white-space: nowrap;">**Boolean A**</td><td style="white-space: nowrap;">True / false</td><td>The first true/false value to check — for example whether a door is open.</td></tr><tr><td style="white-space: nowrap;">**Boolean B**</td><td style="white-space: nowrap;">True / false</td><td>The second true/false value to check — for example whether a window is open.</td></tr></tbody></table>

#### Outputs

<table id="bkmrk-port-type-what-you-g-0"><thead><tr><th style="white-space: nowrap;">Port</th><th style="white-space: nowrap;">Type</th><th>What you get</th></tr></thead><tbody><tr><td style="white-space: nowrap;">**OnTrue**</td><td style="white-space: nowrap;">Trigger</td><td>Fires once at the moment the combined answer becomes true — that is, when at least one input has just turned true. Connect this to whatever should happen when that switch-on moment occurs.</td></tr><tr><td style="white-space: nowrap;">**OnFalse**</td><td style="white-space: nowrap;">Trigger</td><td>Fires once at the moment the combined answer becomes false — that is, when both inputs have just become false. Connect this to whatever should happen when that switch-off moment occurs.</td></tr><tr><td style="white-space: nowrap;">**Result**</td><td style="white-space: nowrap;">True / false</td><td>The current combined answer: true if at least one input is true, false only when both are false. You can read this at any time.</td></tr></tbody></table>

#### Example

<table id="bkmrk-boolean-a-input-door"><tbody><tr><td style="white-space: nowrap;">**Boolean A** input</td><td>Door is open — `false`</td></tr><tr><td style="white-space: nowrap;">**Boolean B** input</td><td>Window is open — changes from `false` to `true`</td></tr><tr><td style="white-space: nowrap;">**Result** output</td><td>`true` (at least one is now open)</td></tr><tr><td style="white-space: nowrap;">**OnTrue** output</td><td>Fires once, because the combined answer just flipped from false to true — you could use it to start a “something is open” warning.</td></tr></tbody></table>

#### Tips

- Use **Result** when you just want the current answer to feed into another node, and use **OnTrue** / **OnFalse** when you want something to happen the moment the answer changes.
- The triggers fire only on a change. If the answer is already true and an input change keeps it true, **OnTrue** will not fire again.
- If you need the answer to be true only when *both* inputs are true, use the **And Operation** node instead.

### Not Operation

Flips a true/false value to its opposite.

#### What it does

This node takes a single true/false value and gives you back the reverse. If the value coming in is true, the result is false. If it comes in as false, the result is true.

It’s handy when you want to react to the opposite of something — for example, doing something only when a door is *not* open, or when a switch is *not* turned on. The value you connect is not changed; you simply get a new, flipped result out.

#### Inputs

<table id="bkmrk-port-type-what-to-co-1"><thead><tr><th style="white-space: nowrap;">Port</th><th style="white-space: nowrap;">Type</th><th>What to connect</th></tr></thead><tbody><tr><td style="white-space: nowrap;">**Input**</td><td style="white-space: nowrap;">True / false</td><td>The true/false value you want to flip — for example, whether a light is on or whether an object is visible.</td></tr></tbody></table>

#### Outputs

<table id="bkmrk-port-type-what-you-g-1"><thead><tr><th style="white-space: nowrap;">Port</th><th style="white-space: nowrap;">Type</th><th>What you get</th></tr></thead><tbody><tr><td style="white-space: nowrap;">**Output**</td><td style="white-space: nowrap;">True / false</td><td>The opposite of what you connected: `false` when the input is true, and `true` when the input is false.</td></tr></tbody></table>

#### Example

<table id="bkmrk-input-true-%28the-door"><tbody><tr><td style="white-space: nowrap;">**Input**</td><td>`true` (the door is open)</td></tr><tr><td style="white-space: nowrap;">**Output**</td><td>`false` — so “the door is not open” is false</td></tr></tbody></table>

#### Tips

- Use this when you want to act on the opposite of a condition without setting up a separate check — for example, to know when something is *not* happening.

---

## Related

- **Branch** — use the **Result** from any of these nodes to send your scene down one path or another.
- Chain these three together to build a bigger check — for example, flip a value with **Not Operation** before feeding it into **And Operation** or **Or Operation**.