Why isn't this part moving? I'm using a Bezier function i found in the ROBLOX wiki and I kinda get it but I'm not sure why it's not moving through out the 3 points without any errors?
function lerp(a, b, c)
return a + (b - a) * c;
end;
function cubicBezier(t, p0, p1, p2, p3)
local l1 = lerp(p0, p1, t);
local l2 = lerp(p1, p2, t);
local l3 = lerp(p2, p3, t);
local a = lerp(l1, l2, t);
local b = lerp(l2, l3, t);
local cubic = lerp(a, b, t);
return cubic;
end;
local StartPoint = Instance.new('Part')
StartPoint.Anchored = true
StartPoint.Size = Vector3.new(1,1,1)
StartPoint.Parent = game.Workspace
StartPoint.CFrame = game.Workspace.Model.A.CFrame
local X = CFrame.new(cubicBezier(3, StartPoint.CFrame.p, game.Workspace.Model.A.CFrame.p, game.Workspace.Model.B.CFrame.p, game.Workspace.Model.C.CFrame.p))
StartPoint.CFrame = StartPoint.CFrame:lerp(X, 2)

1 comment
Thank you so much!