Composition - Lerp

Back to Composition - Main
Get the asset

Note: this documentation is discontinued, I’ll find another way to do it :slight_smile:.

Lerp

Linearly interpolate from value start to value goal using a percent.

  • For example percent 0.5 from 0 to 1 would result in 0.5.
  • percent 0.5 from 0 to 3 would result in 1.5.

The data types for start and goal are seen by the function name and type check. They can have any value within that data type. percent is always a number from 0 to 1.

Summary

Properties

View all inherited from ModuleScript

Functions

  • number(start: number, goal: number, percent: number)
    Returns a number at percent from start to goal.

  • UDim(start: UDim, goal: UDim, percent: number)
    Returns a UDim at percent from start to goal.

  • UDim2(start: UDim2, goal: UDim2, percent: number)
    Returns a UDim2 at percent from start to goal.

  • NumberSequenceKeypoint(start: NumberSequenceKeypoint, goal: NumberSequenceKeypoint, percent: number)
    Returns a NumberSequenceKeypoint at percent from start to goal.

  • ColorSequenceKeypoint(start: ColorSequenceKeypoint, goal: ColorSequenceKeypoint, percent: number)
    Returns a ColorSequenceKeypoint at percent from start to goal.

  • Rect(start: Rect, goal: Rect, percent: number)
    Returns a Rect at percent from start to goal.

1 Like

I recommend keeping your Module’s documentation on the main post (or use #bulletin-board ) to prevent clutter

3 Likes