I’m making a couch co-op game where multiple devices will be connected at once, e.g. one player uses keyboard+mouse and another uses a controller. However because a controller is being used there is an annoying white dot that appears in the middle of the screen which disables the mouse. You can see in this clip what I mean, it’s messing up the inventory system when the keyboard+mouse player is doing stuff and the controller is being pressed:
Ideally I need to get rid of the whole white dot thing entirely so the controller player and mouse can co-exist. I don’t want to have to make a whole custom mouse system. I saw that it might be possible to hide the white dot, but that doesn’t do anything about the mouse disappearing.
Unfortunately for your situation, that little white dot is the mouse. When a player begins using a gamepad, the engine locks the mouse to that point on the screen and changes the icon to look like that. UserInputService:GetMouseLocation() will point to that location, and both players interacting at the same time will cause conflicts. You can hide it by hiding the mouse altogether with UserInputService.MouseIconEnabled = false, but that doesn’t really solve your problem…
The only natively-supported multiplayer input format is multiple gamepads (and I’m not even sure that works with the default UI navigator, so interpret this statement as having an asterisk). You will ultimately need a custom implementation for your use case. You’ll also want to avoid using ContextActionService for input processing since right trigger pulls trigger both Enum.KeyCode.ButtonR2 and Enum.UserInputType.MouseButton1 handlers, at least for Enum.UserInputType.Gamepad1 input. Not sure about others. Or why it does in the first place, but my speculation is ROBLOX trying to improve default gamepad support in games where developers themselves haven’t.
That sucks… I guess I could disable the mouse and make the whole game playable with keyboard only, which wouldn’t be too much of a stretch.
How can I post this as a feature request or something? Do you think it would be possible to get an option to remove this dot added into Studio? I don’t see any downsides to that, as long as it’s enabled by default.
local uis = game:GetService("UserInputService")
local plr = game:GetService("Players").LocalPlayer
uis.LastInputTypeChanged:Connect(function(input)
if input.Name:find("Gamepad") then
plr:GetMouse().Icon = ""
uis.MouseIconEnabled = false
end
end)
Edit: Yeah, no luck, this only appears to prevent whether a gamepad can change the selected UI instance. However, when LastInputType updates to a gamepad, the mouse/cursor icon is still forced into gamepad mode, and the gamepad can still enter UI selection mode.
I’m wondering if SetNavigationGamepad could address the issue here. I’m not sure I’ve ever needed to use this function, so I don’t know the behavior but the documentation stating “sets whether the specified gamepad can move the GuiObject navigator” sounds promising. I’ll do some testing in the morning.
That’s good for hiding the cursor but I need to keep the normal mouse on screen somehow. I might use this method to just disable the cursor completely and make it a keyboard-only game.