Jittery first person camera

I’m making a first-person body camera, the last step I have to completing it is moving the players head a bit forward, however, this makes the camera jittery whilst turning.

script:

local runService = game:GetService("RunService")
local players = game.Players

local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hum : Humanoid = character:WaitForChild("Humanoid")
local head = character:WaitForChild("Head")

local camera = workspace.CurrentCamera


local cameraOffset = Vector3.new(0,0,-1)

hum.CameraOffset = cameraOffset

local function setTrans(transparency)
	for i,v in pairs(character:GetChildren()) do
		if (v:IsA("BasePart")) and (v.Name ~= "Head") then 
			v.LocalTransparencyModifier = transparency;
		elseif (v:IsA("Accessory")) and (v:FindFirstChild("Handle")) then
			if v.Handle:FindFirstChild("AccessoryWeld").Part1 == head then

			else
				v:FindFirstChild("Handle").LocalTransparencyModifier = transparency;
			end
		end
	end
end

game:GetService("RunService").RenderStepped:Connect(function()
	local isfirstperson = (head.CFrame.Position - camera.CFrame.Position).Magnitude < 2
	if isfirstperson then
		setTrans(0)
	end
end)

this is the only script in the game so nothing else is affecting it.

If you could help it would be greatly appreciated.

I can only offer some thoughts here. I believe you would need to fork the CameraModule. Also one thing to notice is that the jitters seem to not occur when you are panning and also pressing the mouse button. Seems like if you can find the code that handles that situation you can add it in your forked module.