I’ve been working on a custom first person camera for my game that introduces smooth mouse movement, up/down and left/right head bob, and tilting. Recently, the character model visible in the camera has begun to jitter erratically when looking around. This is behaviour that I had previously not experienced prior to last Wednesday’s Roblox update (or, at least this is what I believe). To double check this assumption, I went back to earlier versions of the script that I know for a fact were working and had not been touched since the update, and they are the same.
The jitter is actually much harder to reproduce in game as opposed to testing in studio but is still a problem. It’s also more prevalent on lower capped framerates (video is done in 60fps)
Here is the code snippet that applies the changes to the camera, in a function bound with BindToRenderStep with + 1 priority on the Camera
local yScaleVal = yScale(mouseYL)
mouseXL = numberLerp(mouseXL, mouseX, smoothnessFactor * dt * lerpVal)
mouseYL = numberLerp(mouseYL, mouseY, smoothnessFactor * dt * lerpVal)
tilt *= yScaleVal
tilt = numberLerp(tilt, 0, 5 * dt)
sineX *= yScaleVal
sineY *= yScaleVal
sineXL = numberLerp(sineXL, sineX, dt * 25) * walkPercent
sineYL = numberLerp(sineYL, sineY, dt * smoothnessFactor * 4) * walkPercent
fakeHead.CFrame = character.Head.CFrame
local rX, rY, rZ = camera.CFrame:ToOrientation()
if seizeCamera.Value == false then HumanoidRootPart.CFrame = CFrame.Angles(0, rY, 0) + HumanoidRootPart.Position end
local pos = offsetPart.Position
if seizeCamera.Value == true then
sineYL, sineXL, tilt = 0, 0, 0
pos = camHoldRefs[seizeCamera:GetAttribute("camHoldRef")].Position + seizeCamera:GetAttribute("camHoldPos")
end
--pos += Vector3.new(0, sineYL, 0) -- vertical bob
camera.CFrame = CFrame.new(pos)
* CFrame.Angles(0, math.rad(mouseXL / (2.5 / sensitivity)), 0) -- horizontal motion
* CFrame.Angles(math.rad(mouseYL / (2.5 / sensitivity)), 0, 0) -- vertical motion
-- * CFrame.new(sineXL, 0, 0) -- horizontal bob
-- * CFrame.Angles(0, 0, tilt) -- tilt
If anyone could provide some insight on this that would be legendary