Roblox detecting Mouse as Controller, referably Gamepad

I can’t put this under Bug Reports > Engine Bugs.

Quite a few players in my game are experiencing an issue that should only occur for Controller or Mobile players, specifically for controllers. When a player joins and equip a gun, their crosshair is locked in the middle when they have a mouse connected, rather than a controller.

I used UserInputService:GetGamepadConnected(Enum.UserInputType.Gamepad1) instead of UserInputService.GamepadEnabled because I thought it would return true only if a controller is detected, not a mouse.

if not UserInputService.TouchEnabled and not UserInputService:GetGamepadConnected(Enum.UserInputType.Gamepad1) then
	moveEvent = Mouse.Move:Connect(function()
		local viewport = Camera.ViewportSize
		crosshair.main.Position = UDim2.new(Mouse.X / viewport.X, 0, (Mouse.Y + guiInset) / viewport.Y, 0)
	end)
end

For additional information, one of my players uses a Wireless Selecline Mouse.
Any help is highly appreciated. I can provide videos or screenshot if needed.

roblox doesnt have very good support with extra peripherals on devices such as consoles and mobile, have you tried creating a GuiInstance in StarterGui that has the “Modal” value set to true? This unlocks the mouse so that the player can move it to the gui but you may be able to use that to ‘unlock’ the mouse while having the tool equiped

The gui could also be invisible by setting all transparencies to 1 that way it just unlocks the mouse, it also means that the mouse will be unlocked in first person, but you can probably program it to disable Modal while the player is in first person.

1 Like