Players join when join action is Triggered not working when using a reference input action

Hello everyone,

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.

1 Like

Same issue … I really don’t get it. Did you submit a bug report ?

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 is buggy with the last version too : “com.unity.inputsystem”: “1.0.0-preview.6

It is reported there too : Inputmanager when Join behavior is set "When Join Action Is Trigger" pair every device connected to only first user. · Issue #392 · Unity-Technologies/InputSystem · GitHub : but I don’t get why it is closed

I sent a Bug Report with a repro

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:

  1. 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());
  2. 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!

2 Likes

Thanks a lot!

I make “Lobby Actions” with one map and one action for join player. It works for me.

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

There is a fix for this incoming here https://github.com/Unity-Technologies/InputSystem/pull/1344.

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.

1 Like

Thank you. Awaiting eagerly for the fix.

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.

Really glad this is being sorted. Trying to implement this too. Impossible to get more than 1 player connecting using this method XD

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