0

Currently I am using InputSystem and am running into XInput’s hardcoded limit of 4 controllers. I’m looking for any ways to bypass that, e.g. by making my XBox controllers use DirectInput API.

Is there any way to bypass that limit:

  • In Unity, e.g. by using Input instead of InputSystems, or third party assets such as Rewired.
  • In controller settings.
  • Through third-party apps

If not, will using non-XBox controllers help me go past 4? Any advice will be much appreciated.

SurDno
  • 31
  • 1
  • 4
  • I notice the Input Manager drop-down goes all the way up to Joystick 16. Have you tried that route? – DMGregory Feb 01 '23 at 21:03
  • Yes, both InputSystems and InputManager can get the input of joysticks 5 and up. But they simply never receive any input from XBox joysticks due to limitations of XInput. I believe the option is here for PS gamepads that do not have that limitation since they do not use XInput API. – SurDno Feb 01 '23 at 21:21
  • I've used Input Manager with 6+ Xbox gamepads in the past. – DMGregory Feb 01 '23 at 21:29
  • I have just tested this with default settings where Horizontal axis gets input from all joysticks. It gets input from any of the four first connected gamepads, but not any of the latter ones. – SurDno Feb 01 '23 at 22:29
  • Did you try manually choosing gamepad 5, rather than "all"? – DMGregory Feb 01 '23 at 22:33
  • The behaviour with InputSystem is for some reason unstable. I tried doing individual Joystick axes and one shared by all, and I got all 6 of them to work. Then I restarted play mode, did controller reset, and only the first four worked again. I used following code: `for(int i = 1; i <= 6; i++)` `if(Input.GetAxis("Horizontal" + i) != 0)` `Debug.Log("Gamepad " + i + " receives horizontal input of " + Input.GetAxis("Horizontal" + i));` – SurDno Feb 02 '23 at 00:01
  • related: comments on this Arqade post about [working around XInput limitations](https://gaming.stackexchange.com/a/358003) & [OpenXinput](https://github.com/Nemirtingas/OpenXinput), an open-source re-implementation of the XInput driver for Windows that allows for use of more than 4 XInput devices, while maintaining compatibility with standard XInput – Pikalek Feb 02 '23 at 04:01

1 Answers1

0

Yes! Unity itself offers more low level access, although that is probably too cumbersome to work around. The best solution out there is "Rewired" from the Assetstore: https://guavaman.com/projects/rewired/

It offers everything that you could ask for, the only downside would be porting your existing bindings into their UI.

Hope that helps!

Mr.Yellow
  • 692
  • 5
  • 15