So if you read the title, you know exactly what I’m trying to get. Can anybody explain how to lerp a bodymover? (e.g bodyvelocity) I know that you need to do
The lerp function takes the Vector3 value it’s called on and returns a mid point between it and the first parameter (also a Vector3). The second parameter is alpha, its basically how “far” to lerp the two. For example, a lerp with 0.1 would return a vector that’s 10% of the distance to the inputted vector from the vector it’s called on.
tl;dr; it averages two Vectors, with the second parameter being the weight at which they are averaged.
Here is a the function written out:
local function lerp(va, vb, a)--vector2 lerp: va is the Vector lerp is called on, vb is the first parameter (a vector), a is the second parameter (alpha)
return Vector2.new(va.x*(1-a) + vb.x*a, va.y*(1-a) + vb.y*a)
end
To answer you’re question, any vector can be the first parameter. For example, if you wanted to slow the velocity by 10% you could do: