How to toggle first person mode?

Hello, my game has first person mode. Right now, I am setting the cameraMode to lockfirstperson and the scroll out distance to 0.5 minimum

It works well, however when the player dies I want them to be able to move their mouse again.

In my local script I have this:

	plr.CameraMode = Enum.CameraMode.Classic
	plr.CameraMinZoomDistance = 5
	plr.CameraMinZoomDistance = 10
	workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable

	local UIS = game:GetService("UserInputService")
	UIS.MouseIconEnabled = true
		
		

However they still cannot move their mouse. Anyone know why?

Is your script a local script in StarterCharacterScripts?

If you want the player to be able to move their mouse, I would suggest creating a screenGui with a textButton inside. Be sure to disable the screenGui before playing.

Screenshot (36)

Then activate the Modal option in the button.
Screenshot (37)

Modal makes it so that if the button is on the screen, the player can move the mouse. Even in first person.

Then you can toggle it on like this:

local plr = game.Players.LocalPlayer
local gui = plr.PlayerGui.ScreenGui -- replace with the name of your ScreenGui
local hum = plr.Character:WaitForChild("Humanoid")

hum.Died:Connect(function()
    gui.Enabled = true
end)

Thanks my death screen already had textbuttons on it so I just enabled MODAL. You are like goku legend I like goku and you are like goku. If you need a secret favor just ask me okay I can give you a favor. I am talking about if you hve any

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.