I’m not sure why, but there seems to be a problem where player joining only works for 1 player when using the PlayerInputManager when having specific settings. When I have it set-up like in the picture I attached, I can only join a player the first time I press the A button on any controller I have connected, not the second time.
However, it works as soon as I tick off the ‘Use Reference’ setting, and manually add a binding to the action to listen to Button South of a gamepad.
Unable to send bugs I’m afraid. The bug reporter crashes every time I try to send a bug report.
I’ve made a post about it somewhere on the forums a few weeks ago, but I didn’t receive any replies so far.
It seems to me like this is what is happening (weirdness with InputActionReference):
No players are joined, so the action reference is enabled for all controllers
1 player joins, and the join action now gets bound to the player that just joined. The action can no longer be used with other controllers.
I have found two workarounds for this:
Clone the action and tell the input manager to use the cloned action for the join action:
_playerInputManager.joinAction = new InputActionProperty(_playerInputManager.joinAction.action.Clone());
Use a completely separate InputActions asset for actions that shouldn’t be tied to players. This is what I’ve done. I’ve named that asset “GlobalInputActions” and included actions for player joining, opening my debug console, pausing and ui controls.
Hopefully this helps you guys until Unity fixes it!
This works, but now I get another problem:
With each press of the join action it will continuously try to join now that the join action isn’t bound or consumed. If you have set a maximum player limit, you will be spammed with errors saying the player limit is reached.
For example if you have the south gamepad button bound as join, but it’s also the jump button, then there will be this issue. Without the player limit, on the surface there doesn’t appear to be a problem, but debugging reveals the join action event is continuously triggered
This is what is fixed by that pull request, but in the meantime, the workaround suggested by osum4est is to have a completely different action for jump and join. You can even put your join action in a separate action map to keep in-game and UI actions apart.
In the example I gave, I forgot to mention the join button and jump button were on different Input Actions Asset, under differently named maps. Just their bindings overlapped to the same button.
I know this is super late but I found that changing the action type in the input manager to “pass through” and the control type to “any” allows multiple players to join when the action is triggered
also in my case the first player wouldn’t be able to jump but the rest were and after changing this every player can jump now