So this script mostly works....
Basically what this does is when you are not in the game, it takes your camera to a spectator view of the map.
When you die, the game does take your camera successfully to the spectator view
When you respawn, the game does not take your camera back to the player
The player's CameraMode is set to LockFirstPerson
I need to figure out what I can do in the returnToPlayer function, in order to make it... you know... return to the player.
game.Players.LocalPlayer:WaitForChild("InGame") function goToSpectate() workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable workspace.CurrentCamera:Interpolate(workspace.DeadPlayerSpectatePos.CFrame, workspace.DeadPlayerSpectateFocus.CFrame, 2) end function returnToPlayer() workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable workspace.CurrentCamera:Interpolate(game.Players.LocalPlayer.Character.Head.CFrame, game.Players.LocalPlayer.Character.Head.CFrame * CFrame.new(game.Players.LocalPlayer.Character.Head.CFrame.lookVector.x, game.Players.LocalPlayer.Character.Head.CFrame.lookVector.y, game.Players.LocalPlayer.Character.Head.CFrame.lookVector.Z), 0.5) workspace.CurrentCamera.CameraType = Enum.CameraType.Custom workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid end function determine(newVal) if newVal == true then returnToPlayer() elseif newVal == false then goToSpectate() end end game.Players.LocalPlayer.InGame.Changed:connect(determine) determine(game.Players.LocalPlayer.InGame.Value)
At the beginning of the script, put this:
repeat wait() until game.Players.LocalPlayer.Character workspace.CurrentCamera.CameraType = Enum.CameraType.Custom workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
That way, every time the character spawns, the script will reset the character's camera.
Hope this helped!