Simpliest explaination of lerp: it returns a value between the first and the last value based on the percentage you specify.
Let's say your first value is Vector3.new(0,0,0) and your destination value is Vector3.new(100,0,0)
local firstVal = Vector3.new(0,0,0)
local destVal = Vector3.new(100,0,0)
Now, lerping those values by let's say 0.3 would return Vector3.new(30,0,0)
print(firstVal:lerp(destVal, 0.3))
print(firstVal:lerp(destVal, 0.7))
Get it? The 0.3 means it will return like 3/10 of the distance.
Now back to your code, it errors because CFrame:lerp()'s first argument has to be a CFrame aswell, while you're passing a Vector3.
But you can fix it by using CFrame.new()
for i = 1, 20, 0.5 do
hrp.CFrame:lerp(CFrame.new(hrp.Position + hrp.CFrame.lookVector * 8), i/11)
wait(0.08)
end
1 comment
what is the error