Hi, I building a game with Unity and test with a Xbox controller, everything worked perfectly until today, I opened Unity, changed a few lines of code unrelated to inputs, started the game mode and was unable to play with the controller.
Keyboard bindings that shares the sames input actions works, and the previously compiled version works also.
I tried restarting unity, rebooting but nothing change, what can I test ??
I too am having this issue. Not only with an Xbox controller but with a PS4 controller as well. I tried a different machine to see if it was local to my PC but it is happening on both devices. For me, it will sometimes work for a minute or so but eventually, the controller will show up in the “Disconnected” list in the Input Debugger window.
I’m using
Unity Editor: 2021.2.13
InputSystem: 1.3.0
I think I finally worked out what is going on. When I have Steam closed everything works fine. @Entretoize is your game using Steamworks and is steam open while you’re running your game in Unity? If so try closing the Steam client, restart Unity and see if that helps.
It is interesting, yes I’m using steamworks, this is what I tried:
Steam open I launched Unity and game mode: xbox controller wasn’t working
Closed Steam and launched game mode : controller was working
After closed the game mode I tried the controller with the “listen” button in the input action editor and it worked to.
Launched Steam again and the controller still worked in the input action editor
Launched the game mode and the controller stopped working in both the game and action editor
Then it seems that a component takes the input ownership once launched and keeps it.
My problem is that I’m using Mirror with Steamworks and it can’t work without Steam launched. But thank you for pointing this out.
Ah damn that’s a shame. Yeah, I made sure I can run my game outside of Steam as well, so it was pretty quick to become unblocked.
Hopefully, you can put together something quickly so you don’t need the Steam client open. I honestly think this is a good practice anyway unless your game is heavily reliant on Steam’s servers.
But yeah, I think this issue is solved-ish. It must be something to do with Steam and Unity both fighting for control of the gamepad. I haven’t really looked any further into why that is happening.