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

How do i make the Camera zoom distance properties work?

Asked by 6 years ago
Edited 6 years ago

http://wiki.roblox.com/index.php?title=API:Class/Player/CameraMinZoomDistance http://wiki.roblox.com/index.php?title=API:Class/Player/CameraMaxZoomDistance

So i tried setting both those in a server script and a local script but it doesn't really work, is there something i'm doing wrong?

Thanks.

edit, heres the script:

game.Players.PlayerAdded:connect(function(Player)
Player.CameraMaxZoomDistance = 50           
Player.CameraMinZoomDistance = 50   
Player.NameDisplayDistance = 0  
end)
0
Can you include the script you used. User#5423 17 — 6y
0
game.Players.PlayerAdded:connect(function(Player) Player.CameraMaxZoomDistance = 50 Player.CameraMinZoomDistance = 50 Player.NameDisplayDistance = 0 end) V_ChampionSSR 247 — 6y
0
oops, updated the post instead V_ChampionSSR 247 — 6y

2 answers

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

Put a LOCAL SCRIPT in StarterCharacterScripts , in the local script put the following:

local hum = script.Parent:WaitForChild("Humanoid")
local plr = game:GetService("Players").LocalPlayer
plr.CameraMaxZoomDistance = 50
plr.CameraMinZoomDistance = 50
hum.NameDisplayDistance = 0
0
+1, but it should be "script.Parent", and it would be better to call it "plr" not "Plr" to be consistent (in terms of capitalization style) chess123mate 5873 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

The server never manages GUIs nor cameras, so whenever you're working with either you should always use a LocalScript.

When you're in a LocalScript, you don't want to use PlayerAdded to try to get the current player, since the LocalPlayer was already added by the time the script runs. Instead, simply use game.Players.LocalPlayer (or game:GetService("Players").LocalPlayer)

0
the problem wasn't that, i've clearly stated i both tried server script and local script, none worked, not even setting the properties in starterplayer, it was because the cameratype was set to Follow. Yup. V_ChampionSSR 247 — 6y
0
I should have mentioned: I was explaining some of your mistakes, not providing an answer (as abnotaddable had already done that). Good that you got it figured out, anyway chess123mate 5873 — 6y

Answer this question