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.