Lerp expression - more clarity

Well, with the lerp feature, this pops up:

Instead of showing the formula, can you write something there in plain english as to what Value A does, what value B does and what value X does - when you enter said values?

:astonished: You can still keep the formula there - for the math geeks, even though the lerp function makes it unnecessary to know the formula. At least write in plain words what those values are for.

That could be a good idea :slight_smile:
You never ask for it, but if you (or anybody reading it) need help with this, checking the formula (I hope) it works like this:
You interpolate values of X between A (start) and B (finish). It reminds me a parametrized curve, where X would be the renowned time t :smiley:
At time t=0 (X=0), you stand in A
At time t=1 (X=1), you stand in B
At 0<t<1, you stand in the straight line (because it’s linear) between A and B
Finally, at t<0 or t>1, you would be extrapolating

It’s a small feature request. :slight_smile:

I guess that it can be changed in a couple of lines of code.
How can we communicate what these values do in the simplest way possible?

lerp(a, b, x) Linear interpolation of a to b by x. Calculates a + x * (b - a).

a- staring value
b- ending value
x- speed of interpolation ( value must be …)

by the way, do we multiply by time delta in there?
I wish gdevelop used a short word for it- like “dt” or “td”

I wish we had an example of using a lerp in an expression.

For example to get a smooth camera zoom or pan effect. How do you do it with a lerp in gdevelop? :unamused:
Heres a request for a tutorial!