Skip to main content

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).

Inputs

Numbers

DataDescription
First NumberThe first number to compare. Default: 0.
Second NumberThe second number to compare. Default: 0.

Actions

SignalDescription
DoTriggers the comparison. The result is updated only when this signal is received.

Outputs

Data

DataDescription
ResultThe smaller of the two input numbers.

Signals

SignalDescription
DoneTriggered when the calculation is successfully completed.

Usage

Example Use Cases

  1. 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).
  2. Collision: Finding the closest intersection point.
  3. Pricing: Applying the lower of two prices (e.g., a discount vs. regular price).

Detailed Behavior

  1. Validation: Inputs must be valid numbers within ±1,000,000,000,000.
  2. Calculation: Uses Math.min().
  3. 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.