How to detect mouse.Move in first person?

You can use mouse.move to connect to a function like so:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.Move:Connect(function()
	print("Mouse Moved")
end)

But if the player is in first-person then the event wont print.
I’ve looked for solutions but the only thing i could find would be how to make the mouse move in first-person but i want it to stay in the center.
Any fix or alternatives.
Thanks in advance :slight_smile:

Why do you need to detect mouse movement in first person anyway?

Since in first person it automatically rotates your character, you could just listen for a change in the character instead.

2 Likes

You can use the InputChanged event of UserInputService to detect mouse movement.

local UserInputService = game:GetService("UserInputService")

UserInputService.InputChanged:Connect(function(input, gpe)
	if input.UserInputType == Enum.UserInputType.MouseMovement then
		print("Mouse moved")
	end
end)
2 Likes

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