Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Possible to lerp a number?

Asked by 6 years ago

What I mean is if I could change the value of a number from for example 1 to 5 but smoothly and over time with something like quad as an easing style? Also, I would appreciate if you give a small snippet of code so I can check it out.

1 answer

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
6 years ago

Linear Interpolation is quite an easy formula.

function Lerp(a, b, t)
    return a + (b - a) * t
end
0
Yeah, I think my brain was dead late in the night. tobyjing2005 107 — 6y
Ad

Answer this question