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: