Jittery Camera when using this script

I set up a script to roll the camera in the direction of the player’s movement, however, whenever I move while jumping or just walk backwards, the player seems to jitter behind on some frames. I can’t for the life of me figure out the solution, so can you guys help?

Here’s the part of my camera script that handles the rendering:

game:GetService("RunService").RenderStepped:Connect(function(dt)
	local roll = -GetRollAngle() * 2 -- get the roll angle
	rot = rot:Lerp(CFrame.Angles(0, 0, math.rad(roll)), 0.075) -- lerp the roll angle to smoothly transition
	camera.CFrame *= rot -- finally set camera to rot
end)

Vid of the problem:

Hey,

you’re not using the delta time passed by .RenderStepped(function(dt)) end, try multiplying the rot variable by something like this (dt*50).

You might have to play with the magic number as that is how big the rotation will be every frame, the delta time is how much time has passed between the last frame and this frame resulting in a nice number.