Hi. I'm using Lerp inside a Heartbeat function to move one part from one point to another. This works perfectly when I'm trying to move the part to only one point, but as soon as it starts moving to a second point, it starts stuttering and stops in the middle where it stutters even more back and forth.
This is probably explained much better in a gif, so here's a link
Here's the code
local RunService = game:GetService("RunService")
local partA = workspace.A --point A
local partB = workspace.B --point B
local partC = workspace.C --moving part
local speed = 2
RunService.Heartbeat:Connect(function(deltaTime)
local deltaSpeed = deltaTime * speed
local CFrameLerpA = partC.CFrame:Lerp(partA.CFrame, deltaSpeed)
partC.CFrame = CFrameLerpA
wait(5)
local CFrameLerpB = partC.CFrame:Lerp(partB.CFrame, deltaSpeed)
partC.CFrame = CFrameLerpB
end)

2 comments
Sorry for the late reply. Just tried that, and nothing changed, it still stutters.
Alright, fixed the problem. Thank you regardless, though.