RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"When the player dies, the camera will stop following them. How can we fix this?"
You can fix this by creating a script that listens for the character's death and reconnects the camera to the new character when it respawns. Here's a local script that you can place in StarterPlayerScripts: ```lua local Players = game:GetService("Players") local player = Players.LocalPlayer local function onCharacterAdded(character) local humanoid = character:WaitForChild("Humanoid") humanoid.Died:Connect(function() local newCharacter = player.CharacterAdded:Wait() local camera = workspace.CurrentCamera camera.CameraSubject = newCharacter end) end player.CharacterAdded:Connect(onCharacterAdded) ``` This script will wait for the player's character to be added, then listen for the character's death. When the character dies, it will wait for a new character to spawn and set the camera's subject to the new character, making the camera follow the new character.