My brother and I spent another day trying to solve the issue with gamepads in Unity. To recap: if you start the game and plug in your gamepad while the Unity splash screen is displayed, the game will not recognize that a gamepad is connected.
We reported it as a bug to Unity but so far they haven’t approved the report. Even if they approve it, they might not fix it as there are plenty of more serious bugs reported. And even if they planned to fix it, it might take weeks before there’s a patch. The last release of Unity Input System was over two months ago, and it was just a preview version, meaning it’s most likely not ready to be used in final products.
We can’t wait for the fix, we need to solve it in Summer Paws somehow. It looks like we will use Rewired to handle gamepad input but in order to do that we need to do a few things:
- Rewired is not compatible with the new Unity Input System, so we need to completely remove it from our game. It means huge changes in many places in our project.
- We need to overhaul how we handle user input in user interfaces (menu, options, all other windows). Input System made handling user interfaces easy but we can’t use it anymore.
- We used the Unity Collaborate tool to sync the project between my and my brother’s computers so that we could both work on it. If you want to make a very simple game, then Collaborate is fine. But at this point, we need to switch to Git.
- Rewired fixes issues with gamepads but introduces other problems, e.g. it crashed a few times when we were testing it. But maybe it was because we were using a trial version only. Regardless, it will require a few days of testing to make sure it doesn’t break anything in our game.
Edit (June 6th, 2021) Rewired was easier to use than expected. Unity hasn’t fixed the bug yet, but at least they are tracking it now: [Input System] Gamepad is not recognized when it is connected during splash screen