Need help with СameraOffset

Need help with camera offset. It’s broken a bit
Here is a video https://www.youtube.com/watch?v=_Fh1HU33jlY

local character = (game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait())
local humanoid = character:WaitForChild("Humanoid")
local RunService = game:GetService("RunService")


local targetCameraOffset = Vector3.new(0, 0, -2)

RunService.RenderStepped:Connect(function()
	
	local head = character:FindFirstChild("Head")
	if head then
		local headHeightOffset = head.Position.Y - character:FindFirstChild("HumanoidRootPart").Position.Y
		targetCameraOffset = Vector3.new(0, headHeightOffset - 1, -2) 
	end

	
	humanoid.CameraOffset = humanoid.CameraOffset:Lerp(targetCameraOffset, 0.1)

	
	local partsToAdjust = {
		"RightUpperArm", "RightLowerArm", "RightHand",
		"LeftUpperArm", "LeftLowerArm", "LeftHand",
		"RightUpperLeg", "RightLowerLeg", "RightFoot",
		"LeftUpperLeg", "LeftLowerLeg", "LeftFoot",
		"UpperTorso", "LowerTorso"
	}

	for _, partName in pairs(partsToAdjust) do
		local part = character:FindFirstChild(partName)
		if part then
			part.LocalTransparencyModifier = 0
		end
	end
end)