Skip to main content

Overview

This function returns a number between two values based on a given percentage. It’s useful for interpolation and animation calculations.

Parameters

valueBetween(number1, number2, percent, overshoot)
  • Number 1: The value at the start of the range.
  • Number 2: The value at the end of the range.
  • Percent: The percentage between the two values (0.0 to 1.0)
    • Pro tip: Use a percent Expression Editor property, like stack.scrollPercentY.
  • Overshoot: Boolean indicating whether values can exceed the range.

Example

valueBetween(10, 20, 0.5, false)
Returns 15 (50% between 10 and 20).
I