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

Player can zoom out even though camera mode is set to first person?

Asked by 4 years ago

I'm making a third person shooter and have it so that when the player aims by pressing RMB, the perspective switches to first person. I achieve this by doing:

01UserInputService.InputBegan:Connect(function (input, gameHandledEvent)
02    if gameHandledEvent or not ExpectingInput then
03        return
04    end
05 
06    if input.UserInputType == Enum.UserInputType.MouseButton2 and Mouse ~= nil then
07        Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
08    end
09end)
10 
11UserInputService.InputEnded:Connect(function (input, gameHandledEvent)
12    if gameHandledEvent or not ExpectingInput then
13        return
14    end
15 
16    if input.UserInputType == Enum.UserInputType.MouseButton2 and Mouse ~= nil then
17    Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
18end)

While the player is zoomed in, they can still zoom out by using the mouse wheel. How do I fix this?

1
You could try to change the player's maxzoom? That might be a solution. minerpepper 18 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Simply put the player's maxzoom to "0", u dont need any scripts, that's what I did for my game.

Ad

Answer this question