Compare

Checks how two numbers relate and gives true or false.

Parameters

NameTypeDescription
ResultoutputBoolTrue when the comparison holds.
Value 1FloatThe number on the left of the comparison.
OperationEnumHow the two numbers are compared, read from left to right, so Greater is true when Value 1 is greater than Value 2.Choices: Greater, Greater or Equal, Less, Less or Equal, Equal, Not Equal
Value 2FloatThe number on the right of the comparison.
ToleranceFloatHow far apart two numbers may be and still count as equal. Only used by Equal and Not Equal.

The Compare operator checks whether one number is smaller than, larger than or equal to another, and gives true or false. Use it to turn a number into a yes or no, such as a signal passing a threshold.

Animated values rarely land on exactly the same number. To test them with Equal or Not Equal, give the tolerance a small value.

See also Compare for textures.

Keywords: less than, greater than, equal, threshold, condition, boolean