What I want is to make the player launch from the start point to the end point in a bezier curve(basically making a curve) this is used in this game: https://www.roblox.com/games/11459646568/How-Far-Can-You-Backflip
So far i have this, but it’s choppy and I want it to be smoother:
function lerp(a, b, t)
return a + (b - a) * t
end
function quadraticBezier(t, p0, p1, p2)
local l1 = lerp(p0, p1, t)
local l2 = lerp(p1, p2, t)
local quad = lerp(l1, l2, t)
return quad
end
script.Parent.ClickDetector.MouseClick:Connect(function(plr)
local hrp = plr.Character:WaitForChild("HumanoidRootPart")
hrp.CFrame = workspace.Points.StartPoint.CFrame
for i = 1, 100 do
local t = i/100
local updated = quadraticBezier(t, workspace.Points.StartPoint.Position, Vector3.new(0, 100, 0), workspace.Points.EndPoint.Position)
hrp.Position = updated
task.wait()
end
end)