I Cannot Move The Mouse In First Person

Hello!

Problem:

Normally, the users mouse would be hidden until they press “Q,” which would make the mouse icon visible and make the mouse movable using “Enum.MouseBehavior.Default”

Other aspects like making the mouse visible work.

What I’ve Tried

  • Changing the camera zoom and camera mode to 0 so the mouse can move at least.
local UIS = game:GetService("UserInputService")
local Mouse = game.Players.LocalPlayer:GetMouse()

--[[
script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Parent.StatsFrame.Visible = not 	script.Parent.Parent.Parent.StatsFrame.Visible
end)
]]

UIS.InputBegan:Connect(function(Input, Chatted)
	if Chatted then --Chatted is a bool (True/False)
		return --We want to check
	end
	
	
	if Input.KeyCode == Enum.KeyCode.Q then
script.Parent.Parent.Parent.StatsFrame.Visible = not 	script.Parent.Parent.Parent.StatsFrame.Visible
	end
	
	if script.Parent.Parent.Parent.StatsFrame.Visible == true then
	UIS.MouseIconEnabled = true
	UIS.MouseBehavior = Enum.MouseBehavior.Default
  else
	UIS.MouseIconEnabled = false
	UIS.MouseBehavior = Enum.MouseBehavior.LockCenter

	end
	
end)

If you have question or possible solution, please send it under!
Thank You!

Setting the mouse behaviour to default won’t work, as by default the mouse is locked to the centre when in first person anyway. Instead, use a visible TextButton with the Modal property enabled. It’s weird, but that allows the mouse to be moved no matter the camera perspective.

Thanks. IMO It is kinda weird to have some random property for a mouse to move.

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