if i > 2 then
local targetPosition = Vector3.new(waypoints.Position.X, 0, waypoints.Position.Z) -- Access the Position property
local StartPoint = dummy.WorldPivot.Position
for i = 0, 1, 1/20 do
dummy:PivotTo(CFrame.new(StartPoint:Lerp(targetPosition, i)))
RS.Heartbeat:Wait()
end
The reason this is happening is because you are setting the CFrame of the dummy to a cframe without rotation. To fix this, all you have to do is replace this line: