You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.
In the Unity editor and player for Windows, if a controller gets unplugged, and then you get the controller plugged back in, Unity will map the controller to a different player number.
In a test, I had two controllers plugged in, then I opened the Unity project. I ran the demo scene and controller mapping generally worked ( if you ignore the controller number indicator light, see issue #5 ). What I mean by "worked" is that there are two controllers plugged in, and one of them moves player 1 (the red character) while the other controller moves player 2 (the green character).
Now suppose I stop playing the scene, but I still have the Unity editor open. I unplug one of the controllers (in my test this controller was wired and moving player 2) and then I plug it back in, on the same USB port. Then from the editor, I play the scene again. Take note that I only have two controllers plugged in. What will happen is the controller that I "re-plugged" will no longer move player 2, but it will move player 3 (the blue character). In other words, Unity changed its mysterious internal controller mapping when I unplugged the wired controller.
Unfortunately there's no good workaround for this, except to restart Unity or the built game.
From my testing, this problem doesn't appear to exist for wireless controllers. That assumes the wireless controller was turned off by removing the battery and turned on again. It will work as expected. The problem explained above only occurs for wired controllers.
The text was updated successfully, but these errors were encountered:
I had a wireless Xbox controller plugged into my Mac, but it wasn't turned on. I opened Unity first, then I turned on my Xbox controller. I was able to move player 1 in the demo. In otherwords, this issue doesn't appear to exist on Mac, so I'll label it as a Windows only problem for now.
This problem has been seen in Windows native players as well. And throughout any Windows target, this issue only occurred in wired controllers. Updating the issue to reflect that.
On Windows, wired controllers get mapped to a joystick number inappropriate to the number of controllers plugged in. This newly mapped joystick number is generally unpredictable. For example, if controller 1 was wired and disconnected, reconnecting it could re-map it's player control to Player 3, Player 4, or maybe even a larger number depending on how many controllers were plugged in prior.
In the Unity editor and player for Windows, if a controller gets unplugged, and then you get the controller plugged back in, Unity will map the controller to a different player number.
In a test, I had two controllers plugged in, then I opened the Unity project. I ran the demo scene and controller mapping generally worked ( if you ignore the controller number indicator light, see issue #5 ). What I mean by "worked" is that there are two controllers plugged in, and one of them moves player 1 (the red character) while the other controller moves player 2 (the green character).
Now suppose I stop playing the scene, but I still have the Unity editor open. I unplug one of the controllers (in my test this controller was wired and moving player 2) and then I plug it back in, on the same USB port. Then from the editor, I play the scene again. Take note that I only have two controllers plugged in. What will happen is the controller that I "re-plugged" will no longer move player 2, but it will move player 3 (the blue character). In other words, Unity changed its mysterious internal controller mapping when I unplugged the wired controller.
Unfortunately there's no good workaround for this, except to restart Unity or the built game.
From my testing, this problem doesn't appear to exist for wireless controllers. That assumes the wireless controller was turned off by removing the battery and turned on again. It will work as expected. The problem explained above only occurs for wired controllers.
The text was updated successfully, but these errors were encountered: