Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how can i freeze player's camera when he dies?

i want that when a player dies, they can't move the camera until they respawn again thanks

1 answer

insert a localscript in startergui and do like:

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local cam = workspace.CurrentCamera -- Gets the camera

char.Humanoid.Died:Connect(function()
	--Locks camera when everytime character dies
	cam.CameraType = Enum.CameraType.Scriptable
end)

plr.CharacterAdded:Connect(function()
	--Unlocks camera everytime when character spawns
	cam.CameraType = Enum.CameraType.Custom
end)

1 comment

0

I'm pretty sure Enum.CameraType.Fixed instead of Enum.CameraType.Scriptable also works

This discussion is preserved as it was. New answers, comments, and votes are closed.