How do i fix that i can look around in shiftlock/firstperson using CameraSubject = Head

is there any way i can fix this

– video

robloxapp-20250102-0758319.wmv (1.9 MB)

– code

– made by Theothegreat468
– place in StarterCharacterScripts

local head = game.Players.LocalPlayer.Character.Head
local camera = workspace.CurrentCamera

camera.CameraSubject = head

1 Like

If you want your avatar to not be blocking the camera, try this:

local Character = game.Players.LocalPlayer.Character
local Head = Character.Head
local Camera = workspace.CurrentCamera

Camera.CameraSubject = Head

local OldProperties = {} -- Holds the last properties so they can be properly reverted

local function ShowParts(Hide)
	for _, Object in pairs(Character:GetDescendants()) do
		if Object:IsA("BasePart") then
			-- Hide/show all parts
			if Hide then OldProperties[Object:GetFullName()] = Object.Transparency end
			Object.Transparency = Hide and 1 or OldProperties[Object:GetFullName()]
		elseif Object.ClassName == "ParticleEmitter" then
			-- Might also want to hide particles
			if Hide then OldProperties[Object:GetFullName()] = Object.Size end
			Object.Size = Hide and NumberSequence.new(0) or OldProperties[Object:GetFullName()]
		end
	end
end

local Hidden = false -- Whether the character is hidden
Camera:GetPropertyChangedSignal("CFrame"):Connect(function() -- Whenever the camera moves
	local cf = Camera.CFrame -- Current position
	local focus = Camera.Focus -- Where exactly the camera is trying to focus on (your head)
	-- Get the distance from the camera to your head
	local Distance = math.abs(cf.X - focus.X) + math.abs(cf.Y - focus.Y) + math.abs(cf.Z - focus.Z)
	if Distance < 1 then -- most likely first person if true
		if Hidden then return end
		Hidden = true
		ShowParts(true)
	else
		if not Hidden then return end
		Hidden = false
		ShowParts(false)
	end
end)
1 Like

THANK YOU SO MUCH :grinning:
ill mark you solution

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.