I added a spectate feature to my game however whenever the player that the camera is follow dies the camera doesn’t reset with the character so it is just stuck in one spot where the character was right before they died.
local camera = game.Workspace.CurrentCamera
local number = 1
local plr = game.Players.LocalPlayer
local Players = game.Players:GetPlayers()
script.Parent.Next.MouseButton1Up:Connect(function()
number = number + 1
if Players[number] ~= nil then
camera.CameraSubject = Players[number].Character.Humanoid
script.Parent.Player.Text = Players[number].Name
end
if Players[number] == nil then
number = 1
camera.CameraSubject = Players[number].Character.Humanoid
script.Parent.Player.Text = Players[number].Name
end
end)
This is what I have so far.