Camera Offset Change When Entering First Person?

How could I maybe change the Players Humanoid ‘Camera Offset’ when the player enters first person?
Additionly how could I make the transition smooth (Because most games so a kinda glide or tweening of the camera to place it in the new offset position) and make sure that Shift Lock doesn’t interfere? (This is because for me, shift lock moves the players camera slightly backwards, making the camera offset unaligned.)

Just to show a solution that I’ve programmed myself:

local runService = game:GetService("RunService")

local character = script.Parent
local humanoid = character.Humanoid
local head = character.Head

local camera = workspace.CurrentCamera

runService.RenderStepped:Connect(function()
	local distance = (head.Position - camera.CFrame.Position).Magnitude
	humanoid.CameraOffset = distance <1.5 and Vector3.new(0, 0, -1) or Vector3.new(0, 0, 0)
end)

This script doesn’t add any of the smooth tweening or Shift Lock prevention that I would idealy want to add and I think it might be too unefficient because it checks every time the render has stepped.

Any possible solutions or redirections would be greatly appreciated! Sorry if this post was a little long or confusing, I just wanted to make sure that all the details where there.

Hey! A little confused about whether your problem is, is the camera offset not changing when you are in first person? Also you can detect if the player is using shift lock by UIS.MouseBehaviour and check if its using lock center.

Hey, sorry if It was a little confusing! In most horror games I play on roblox, there seems to be an identical way of handling first person? Like when ever I enter first person theres a little smooth transition to changing the cameras offset and it disables shift lock. Because it looks and acts so simmilar I was wondering if it was like an inbuilt thing or plugin?