2/26/2024 0 Comments Incontrol unity multiplayerHowever, a keyboard-based action will pick up at the next button from where it was previously instead of where the mouse was if that was the most recently selected button. I came up with a hack so that the current button stops being highlighted if either the mouse enters the domain of another button, or the user presses a key (OnPointerEnter OnSelect). If I highlight one with the mouse, I can still use the arrow keys to highlight others simultaneously. I can also highlight them with the keyboard but I have to use the up and down action keys. I can highlight any of them with a mouse in any order by hovering over them with the cursor. Let's say I have five buttons in a vertical group. I'm wondering if there's some way to unite keyboard and mouse control with InControl when I'm using its event system with Unity's GUI components.I can describe my problem using a list of buttons. Native input is only supported on Windows and Mac and can be enabled in the settings. The tldr is that InControl does (and has for a couple years) had a native input module that gets around this problem using direct access to native OS input and doesn't disconnect all controllers when one disconnects since it can properly hook into OS level events. In any event, the native input plugin gets far more information about each device from the OS including attach/detach events and, when available, a unique hardware serial number which is used to reassign a reconnected controller to the same device object it had before it was disconnected. I think that's a pretty good UX design strategy even if specific device disconnects can be detected anyway. A multiplayer game should still be able to handle this by showing a controller selection UI on any disconnect (similar to what Nintendo Switch games do, for example) allowing players to "activate" controllers by pressing some controls and reassigning players. That makes it impossible to tell which specific device in the list disconnected and the only reasonable response InControl has is to trigger a disconnect for them all, and then reattach new devices for those still in the list. Unity gives no indication of which one of the four it was. ![]() So when a controller disconnects, one of those identical names in the list disappears. If you connect four identical controllers-a fairly common scenario-then you'll get four identical names in the list and the order of the list is undefined (regardless of the player lights on the controller, for example). The problem with Unity Input is (and I've complained to Unity at length about this) the only identifiers it gives you is the names in the Input.GetJoystickNames list. ![]() Native input is only supported on Windows and Mac and can be enabled in the settings.īut if the native input module is not enabled (and I really do recommend everyone use the native module whenever possible) then InControl has to default to using Unity Input under the hood. Click to expand.The tldr is that InControl does (and has for a couple years) had a native input module that gets around this problem using direct access to native OS input and doesn't disconnect all controllers when one disconnects since it can properly hook into OS level events.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |