Boolean
This node stores and manages a true/false value.
The Boolean node holds a boolean state that can be updated, read, and monitored for changes.
The Boolean node is a variable container for logical data (true or false). It stores a boolean value and provides mechanisms to update it either immediately or upon a signal trigger.
Inputs
General
| Data | Description |
|---|---|
| Value | The boolean value to store. Default: false. |
Actions
| Signal | Description |
|---|---|
| Set | Triggers the update of the stored value. If connected, the Value input is buffered until this signal is received. |
Outputs
Data
| Data | Description |
|---|---|
| Value | The currently stored boolean value. |
Signals
| Signal | Description |
|---|---|
| Changed | Triggered whenever the stored value changes (i.e., toggles from true to false or vice versa). |
| Stored | Triggered when the Set action is completed, regardless of whether the value changed. |
Usage
Use the Boolean node to store flags, toggles, and binary states.
Modes of Operation
- Direct Update (Default):
- Leave the Set input disconnected.
- Any change to the Value input immediately updates the stored value and triggers the Changed signal.
- Explicit Update (Buffered):
- Connect a signal to the Set input.
- Changes to the Value input are "buffered" internally.
- The stored value only updates (and outputs change) when the Set signal is triggered.
Example Use Cases
- Toggle Switch: Store the state of a UI toggle (On/Off).
- Game State: Track if the game is paused (
isPaused). - Conditional Logic: Store the result of a complex check to be used later.
Detailed Behavior
- Type Casting: Any input provided to Value is automatically converted to a boolean (
Boolean(value)).0,"",null,undefinedbecomefalse.- Any other value becomes
true.
- Change Detection: The Changed signal only fires if the new value is strictly different from the current value.
- Stored Signal: The Stored signal fires every time Set is triggered, even if the value remains the same.
Troubleshooting
- Value Not Updating: If you have connected a wire to the Set input, the node enters "Explicit Update" mode. You must trigger the Set signal for the value to update.