So I found this script that makes the camera focus on the player's head, but whenever i die and respawn it just doesn't work anymore. Can someone tell me what the problem is and how to fix it? here's the code;
local plr = game.Players.LocalPlayer
local char = plr.CharacterAdded:wait()
local hum = char:WaitForChild("Humanoid")
local rootpart,head = char:WaitForChild("HumanoidRootPart"),char:WaitForChild("Head")
game:GetService("RunService"):BindToRenderStep("CameraOffset",Enum.RenderPriority.Camera.Value-1,function()
hum.CameraOffset = (rootpart.CFrame+Vector3.new(0,1.5,0)):pointToObjectSpace(head.CFrame.p)
end)
Other info: This is a LocalScript located in StarterPlayerScripts, and FilteringEnabled is on
also i only know the pure basics of scripting so please don't confuse me :p

1 comment
Could you please accept the answer if it worked?