Comparison
Intro
Perform simple comparison operations on values.
UI
First - Set a value to compare with Second.
Operation - Determine the comparison operation:
- Less Than - Output true if
First < Second
. - Greater Than - Output true if
First > Second
. - Equal To - Output true if
First = Second
. - Not Equal To - Output true if
First ≠ Second
. - Less Than Or Equal To - Output true if
First ≤ Second
. - Greater Than Or Equal To - Output true if
First ≥ Second
.
Second - Set a value to compare with First.
Result - A read only preview of the output. Comparison will output a value of 1 when the result is true
and a value of 0 when the result is false
.
Example
- Create a Rectangle.
- Create a Comparison Utility.
- Set Second to 0.
- Create a Value Array.
- Add a second index to the Value Array and set it to 45.
- Connect rectangle.position.y→comparison.first.
- Connect comparison.id→valueArray.arrayIndex.
- Connect valueArray.id→rectangle.rotation.
When the Rectangle's Y Position falls below 0, the Comparison returns true (1) which sets the Value Array's index to 1 which then sets the Rectangle's Rotation to 45.