Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 745 Bytes

Lerp.float.float.float.md

File metadata and controls

50 lines (32 loc) · 745 Bytes

Lerp(float, float, float)

Linearly interpolates between from and to, depending on amount.

float Lerp(float from, float to, float amount)

Parameters

from

Type: float

The start value.

to

Type: float

The end value.

amount

Type: float

How far between from and to to transition (0 - 1).

Returns

float

The value between from and to.

Examples

// ease out from "from" to "to"
float from
float to
float speed
on Play()
{
    from = 0
    to = 100
    speed = 0.05 // 5% between from and to
}
from = lerp(from, to, speed)