I can start the game with no pads connected, and plug in a pad, it works fine.
But if a pad is disconnected while the game is running, then plugged back in, it does not work.
After some debugging I can see that the pad is re-added to the main list of devices (InputSystem.devices), but is not re-added to my PlayerInput that controls my game. At that point both the device lists in PlayerInput.devices and PlayerInput.user.devices show only the keyboard and mouse, and don’t re-add the pad. When I then push a button on the pad PlayerInput.devices and PlayerInput.user.devices show 0 devices (although the keyboard and mouse still work), and I get 2 IndexOutOfRangeException errors.
Clearly the re-connected device needs to be re-added to my PlayerInput.
Should this happen automatically (like it does if hasn’t been connected before)?
Can I do it manually? If so how?
Please help!! My game comes out soon and I’d like this to be sorted.
This help's me for determine witch device is disconnected or reconnected. I put this code at awake method for registration. I must to create my own List os devices, because unity doesn't update at the moment. I know that this isn't the best way. ``` InputSystem.onDeviceChange += (device, change) => { switch (change) { case InputDeviceChange.Added: myDeviceList.Add(device); break; case InputDeviceChange.Removed: myDeviceList.Remove(device); break; } };
– PabloOHQ