Difference between lerp and vinterp?

So I had this question, what does exactly differentiate lerp and vinterp?

Thanks.

1 Like

Lerp chooses a spot between A and B based on a float.

Interp smoothly moves value A to value B, at the speed you choose.

As an example, say you have a path from A to B but you want it to go back and forth, then teleport midway back to the start. You do that based on a float with Lerp (smoothly from 0 to 1, then 1 to 0, then abruptly change to 0.5)

Interp can also be framerate independent thanks to the built in delta time value.

1 Like

Not built in as far as I know but since you can change the speed parameter during interpolation, you could create a function that gets distance between A and B and changes the speed float according to that distance. You should clamp values so it never gets to high (instant) or too low (still).

Alright, so is there any way to control easing (acceleration) in vinterp? like if it starts fast and ends slow or starts slow and ends fast?

the parameter inter speed for vinterp is a value between 1 and 0 or a cm/s value ?

InterpSpeed is multiplied by DeltaTime. That result is clamped b/t 0 and 1. Then it’s multiplied by the vector distance between the two and added to the A vector.

Super old thread, but for future sake, there is an Ease function which allows you to specify the specific function used to smooth the interpolation (sine, linear, exponential, ease etc)

Exactly, ease function is definitely the best choice here. It has various functions.