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

How to disable a player from zooming out?

Asked by 8 years ago

Can anyone help me with disabling a players ability to zoom out other wise first person only?

1 answer

Log in to vote
0
Answered by
Pyrondon 2089 Game Jam Winner Moderation Voter Community Moderator
8 years ago

This can be achieved using the properties of the camera and the player. If you don't want them to zoom out, you can lock their camera at a certain zoom by setting the Min and Max zoom to the same number.

In a LocalScript:

local player = game.Players.LocalPlayer
player.CameraMinZoomDistance = 15
player.CameraMaxZoomDistance = 15

To lock in first person, you would set the camera mode. Also in a LocalScript:

local player = game.Players.LocalPlayer
player.CameraMode = Enum.CameraMode.LockFirstPerson

Hope this helped!

Ad

Answer this question