Input System: Getting all gamepads on console

Hello everyone,

I’ve been developping a multiplayer game for console with the new input system and have been wondering about gamepads orders lately.

I know about using Gamepad.all to get all the connected gamepads, but my question is: Is this array ordered properly when playing on PS4 or on XOne? (e.g. Slot 1 = [0], Slot 2 = [1])

I am mostly posting now because my controllers plugged in my PC switched position overnight and I am not sure if this is because of the array or it was just windows processing in a different order on startup.

Thanks for y’alls time!

Gamepad.all won’t be ordered in a specific way. Would recommend not relying on / expecting any specific order (regardless of platform).

For PS4, Xbox, and Switch gamepads, you can get the relevant platform-specific information from the respective platform-specific classes (e.g. DualShockGamepadPS4 exposes PS4-specific information).

Thank you for the quick answer, I will look into that!