Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to change CameraMinZoomDistance in runtime?

Asked by 4 years ago

so i have a script that zooms out the camera when player died but for some reason changing the CameraMinZoomDistance value doesnt work, but it works with CameraMaxZoomDistance

here is my script:

function udead(whodat, whodatplr)
    whodat.Humanoid.Died:connect(function()
        --script.dead:Clone().Parent = whodatplr.PlayerGui
        print("player died")
        whodatplr.CameraMinZoomDistance = 15
        whodatplr.CameraMaxZoomDistance = 16
    end)
end

game.Players.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:wait()
    udead(plr.Character,plr)
    plr.CharacterAdded:connect(function(char)
        udead(char,plr)
    end)
end)

Answer this question