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)
After you change PartC's CFrame to CframeLerpB it goes straight into changing the CFrame to CFrameLerpA as it is constantly running that block of code
Consider adding a wait after line 16 "partC.CFrame = CFrameLerpB"