I tried to make the default first-person camera slightly better by adjusting the Humanoid’s CameraOffset so that the camera’s position is exactly in the head’s middle.
The script:
-- In RenderStepped
local OffsetVal = (hrp.CFrame + Vector3.new(0, 1.6, 0)):toObjectSpace(head.CFrame).p;
-- 1.6 because I measured that the default first-person camera's centre of rotation is exactly 1.6 studs above the humanoid root part's centre
Offset = OffsetVal + (char.Head.CFrame.UpVector * 0.1) + (char.Head.CFrame.LookVector * 0.4);
-- 0.1 because the "eyes" (decal) are around 0.1 studs above the head's centre
-- 0.4 because the head is around 0.8 studs wide and the eyes have to be on the surface of it
hum.CameraOffset = Offset;
(Note: I changed the Minimum Camera Zoom Distance to 0.1 instead of 0.5 so it’s more accurate)
(Note 2: There’s a body tilt script that slightly tilts the head and torso based on the camera Y position)
This seemed okay but when I tested it the camera moved around the body weirdly:
Any idea how to fix this or what I did wrong?