So in my game, I set the camera mode to lockfirstperson and set max and min zoom distances to 0.5 . However, I want the camera to zoom out when the player dies to about 20(..zoom units?). Here's the script I made.
local Player = game.Players.LocalPlayer local character = Player.CharacterAdded:wait() ; Character = Player.Character local hum = char:WaitForChild("Humanoid") game:GetService('Players').PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) character:WaitForChild("Humanoid").Died:Connect(function() game.StarterPlayer.CameraMaxZoomDistance = 20 game.StarterPlayer.CameraMode = Classic end) end
However, nothing happens. It doesn't zoom out, it doesn't reset, nothing. Please fix my script and tell me what I did wrong.
Changing the StarterPlayer, just like the StarterCharacter and the StarterGui (and all of the other Starter* classes) doesn't affect anything live. Instead you should modify the Player itself. You may as well also do this from a LocalScript and ask yourself why you need both a LocalPlayer and a PlayerAdded connection.