Min
This node returns the smaller of two numbers.
The Min node compares two values and outputs the minimum.
The Min node takes two numeric inputs and simply outputs whichever one is smaller. It is useful for capping values (e.g., ensuring a value doesn't exceed a maximum limit).
Numbers
| Data | Description |
|---|
| First Number | The first number to compare. Default: 0. |
| Second Number | The second number to compare. Default: 0. |
Actions
| Signal | Description |
|---|
| Do | Triggers the comparison. The result is updated only when this signal is received. |
Outputs
Data
| Data | Description |
|---|
| Result | The smaller of the two input numbers. |
Signals
| Signal | Description |
|---|
| Done | Triggered when the calculation is successfully completed. |
Usage
Example Use Cases
- Capping a Value (Clamping Top): Ensure a value doesn't go above a limit.
First Number: Current Health (e.g., 105 after healing).
Second Number: Max Health (e.g., 100).
Result: 100 (The health is capped at max).
- Collision: Finding the closest intersection point.
- Pricing: Applying the lower of two prices (e.g., a discount vs. regular price).
Detailed Behavior
- Validation: Inputs must be valid numbers within ±1,000,000,000,000.
- Calculation: Uses
Math.min().
- Trigger: Only updates on
Do.
Troubleshooting
- Confusing Name: "Min" is often used to limit a value from going higher (capping the top). To limit a value from going lower (capping the bottom), use Max.