How to differentiate multiple Controllers?

If I want to do Local Coop with multiple Input Devices , say, Three Gamepads, then How do I Differentiate between them. In the current Input System, I might use a prefix like “P1_Horizontal”, “P2_Horizontal” and So on for every Input, which is a pain .
Does the New Input System Solve this in any way. Can it detect Hot plugging of Gamepads?

Thank You!

Short answer: You can and it does. And we’re working on some nice high-level wrappers to make this super easy to set up. Stay tuned. Should be available very soon.

Long answer: ATM there’s no differentiation at the design time level. Meaning that right now there’s no way to specifically bind to “second gamepad” or “third gamepad”. Or, well, there’s a way of doing it by hacking around with the path strings but it’s not a good way. Even if this kind of differentiation gets added to the editor, it’d not be a good way to set up local-coop.

Instead, you simply set up your actions generally. Say, if you want to support to gamepad, you simply create bindings the way a single player would use them. Then at runtime, you duplicate the actions and assign them to each player. The entire action/device/player/account correlation stuff is handled by the InputUser API.

However, that stuff right now is fairly tedious and technical to use. The above-mentioned components are meant to hide all this machinery for standard use cases and make it trivial to set up things like local co-op. I’ll post details as soon as the stuff has made it in.

1 Like