I have a camera that uses delta time to make the look consistent between frame rates but when the player resets the camera starts to stutter badly heres my code:
function updateCam(DeltaTime)
Accumulated += DeltaTime
while Accumulated >= Rate do
Accumulated -= Rate
subject.Position = subject.Position:Lerp(Vector3.new(torso.Position.X - Vals['.XOffset'].Value,torso.Position.Y + Vals['.Height'].Value,torso.Position.Z - Vals['.ZOffset'].Value),1/Vals['.Weight'].Value)
subject.CFrame = subject.CFrame:Lerp(CFrame.fromOrientation(math.rad(Vals['.X'].Value),math.rad(Vals['.Y'].Value),math.rad(Vals['.Z'].Value)) + subject.Position, (1 / Vals['.Weight'].Value))
cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = subject.CFrame
cam.FieldOfView = 15
end
end
local connect = RunService.RenderStepped:Connect(updateCam)
Character.Humanoid.Died:Connect(function()
connect:Disconnect()
end)
Heres video of what happens
I found this devforum post but i dont understand how to interpret the solution: Major camera stuttering when lerping to an object (delta time issue) - #14 by plasma_node