Trying to setup multiple controllers to use the Player Input Manager. I’ve created a prefab with PlayerInput script on it. And setup a button for joining the game in the input action asset (spacebar/button south).
If I’ve set the Player Input Manager component join action to use a reference, only one controller joins when pressing the join button. If I uncheck it and use actions I’ve setup on the component directly, the controllers join as expected.
i think i’m seeing this problem too (2020.1.4), if the join behaviour is set to join player when a button is pressed its fine, but if i choose a join action and bind it to an action only the first controller works. this happens even using the unity multiplayer sample in the package. what am i missing here?
okay so this seems not to be a new ‘problem’ - its been reported on the web for months now and apparently a support ticket was closed. it’s 1.0.0 and released now, so can someone from unity please please please either explain why this doesn’t how we seem to think it should work, or what’s going to be done about it if its not working as intended.
Got the same issue. I was sure I posted a bug report then realized I wanted to wait to test it on Windows (I was on Linux) before reporting it. Sorry, we could have gained some time if I had posted it earlier… I’m going to test once more today and report if needed.
Actually I tried to find the cause of the issue by debugging the source code esp. the JoinPlayerFromActionIfNotAlreadyJoined method, but got lost in the code and couldn’t find a reason.
UPDATE: arg, need to check if the bug is only within the Editor or also in the standalone Player before submitting
Also got issues with my MWP where they ask me to sign in with a glitchy button so I can’t easily install the Input System package from UI… I may send the bug report without an example project in the end. Or I’ll send our actual project, as it’s not too big…
They have a bug case here which i have added a vote for:
the ticket i mentioned as closed wasn’t mine it was something i read somewhere on the forums.
this seems like quite a big flaw to me as i’m used to working with Rewired which has similar action events, but i really want to be able to use the nice input system feature where a gaming profile gets attached to the player (xbox live etc)
I think this is because the first player joined “steals” the join action for itself from the InputAsset, such that every time the action is pressed again, the instantiated PlayerInput receives it instead of being fired globally on the manager.
It seems that I’ve solved the problem on my project by disabling the new PlayerInput as soon as it is created, and wait for the required number of players to be there before re-enabling all of them.
That’s a good shout, I’ve not really picked up on how the PlayerInput scripts are supposed to sit in the hierarchy of things. I have been using rewired for a while and this seems similar in some ways and then way out there in others. I only need a join function in the UI/lobby, it feels like I need a unique script for that and not the PlayerInput example that’s provided.
I’ve been debugging this issue for like a week straight, disabling on join seems to work, right now I’m just re-enabling manually in the inspector.
In my case I have a SpawnPoint component (script) which is spawning the prefabs individually one at a time, so I’m not sure how to wait for this to finish since the order isn’t guaranteed. Actually in my case the Player 2 spawn triggers before the Player 1 spawn.
Where do you guys actually reenable the PlayerInput?
Without having access to your project, harder to say.
For me, I initialize all my players on Start(). So after all my players are initialized, but before Start Finishes, I reenable the PlayerInput components.
they might have fixed this problem now!? But if your annything like me you pressed no to restart unity when installing the input system… restart your projekt!!! fixed it!