Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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:

UserInputService.InputBegan:Connect(function (input, gameHandledEvent)
	if gameHandledEvent or not ExpectingInput then
		return
	end

	if input.UserInputType == Enum.UserInputType.MouseButton2 and Mouse ~= nil then
		Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
	end
end)

UserInputService.InputEnded:Connect(function (input, gameHandledEvent)
	if gameHandledEvent or not ExpectingInput then
		return
	end
	
	if input.UserInputType == Enum.UserInputType.MouseButton2 and Mouse ~= nil then
	Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
end)

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

1 comment

1

You could try to change the player's maxzoom? That might be a solution.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.