Unity New Input System - Strange player joining behaviour

Hello I have been trying to set up multiplayer with the new input system. I’ll give a quick description of my setup:

I have a player input manager which is set to spawn a PlayerInput prefab

6867653--801287--upload_2021-2-24_1-37-37.png

The PlayerInput is as follows, I have the events hooked up to methods in the InputSender so for example when the playerInput event “move” fires, the InputSender will take it, do stuff to it and pass it on.

6867653--801293--upload_2021-2-24_1-38-38.png

My issue is that if I log the events in the InputSender I am seeing this in the console:
(that is gameObject.name and a few other things)

6867653--801296--upload_2021-2-24_1-41-7.png

The “PlayerInput” gameObject does not exist in the scene, only the clone but it seems like a PlayerInput prefab has been created and destroyed or something? Debugging the playerInputManager yielded no interesting results, everything was as expected and I’m totally mystified.

I have no idea where this phantom playerInput is coming from or how this is even possible.

Has anyone experienced anything like this? Or know of any bugs with how the playerInputManager creates players? I have been searching but can’t find any answers.

Thanks and let me know if you need anymore info!

Ok it seems when using Invoke Unity Events for the Player Input behaviour, when the first player joins it will also create a Player Input for index -1 which links the events. After this the player input at index -1 is removed but the events do not get cleared.

If you then press a key it will invoke the event for player -1 and player 0. Not sure if this is a very specific setup issue or if this is a bug but for now I have changed to use “send messages” for the behaviour and that is working fine. :eyes: