What is it for?
- Testing whether a value has crossed a threshold
- Producing a
Boolfor the condition of aSwitch - Building a condition such as "move only while this value is greater than 0"
Overview
Compares two numbers and returns true or false. It is the entry point for adding
conditions to a graph. Connect its Bool output to a switch condition or to the
on/off input of a gate.
Usage tips
- The standard three-node pattern is value â
compare(against a threshold) âswitch(orgate). This creates step changes such as changing color after time passes 0.5. - Pairing it with a waveform creates a periodic condition.
motion (Wobble)âcompare(GreaterThan 0) yields true only during the first half of the wave, effectively a Bool version of a square wave. Equal/NotEqualuse a fixed absolute-difference threshold of1e-9, not exact equality. Use Value Match's approximate mode when you need a configurable tolerance.
Related nodes
switchâ choose a value from the comparison resultgateâ stop a chain based on the comparison resultvalue_matchâ test equality for text, colors, and other non-numeric valuesexpression_floatâ write compound conditions as an expression
Comparison modes
Equal- Returns
truewhen|A - B|is less than1e-9.
- Returns
NotEqual- Returns
truewhen|A - B|is at least1e-9.
- Returns
LessThan- Returns
truewhen A is less than B.
- Returns
LessEqual- Returns
truewhen A is less than or equal to B.
- Returns
GreaterThan- Returns
truewhen A is greater than B.
- Returns
GreaterEqual- Returns
truewhen A is greater than or equal to B.
- Returns
Notes
- This node is numeric only.
- You can mix
IntandFloatinputs. - The fixed
1e-9threshold forEqual/NotEqualcannot be changed in the Inspector. - To test whether text, colors, or other values are equal or different, use Value Match.
Examples
- Compare the result of
Math Opwith0.5usingGreaterThan- Tests whether it exceeds
0.5.
- Tests whether it exceeds
- Compare with
0usingEqual- Tests whether the input is 0.
- Compare
Numeric Inputwith100usingLessEqual- Produces true only when the input is 100 or less.
- Connect the result of
ComparetoSwitch- This is the basic branching pattern.