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

Camera Limit not working properly?

Asked by 7 years ago
Edited 7 years ago

So I have a really basic script here that is supposed to limit the max distance a character can zoom out, and it works as expected in studio but it does nothing when I'm in an actual game. The script is located under Workspace and is not a local script, just a regular server script.

Here is the script, it's literally 2 lines.

wait(0.1)
game:GetService("Players").LocalPlayer.CameraMaxZoomDistance = 10

1 answer

Log in to vote
1
Answered by 7 years ago

You cannot use "LocalPlayer" using a Server-Script. I recommend changing it to a LocalScript and putting the script under "StarterGui"

If you want to keep it in a server-script, change the code to:

game:GetService("StarterPlayer").CameraMaxZoomDistance = 10
0
Thanks for the help, dumb mistake on my part lol. noob1126 34 — 7y
0
Any time! User#2146 0 — 7y
Ad

Answer this question