Player Input Manager spawn too many players

Hi !

I just created an empty project in order to test the new Input System.
I initialized a Player Input Manager, with a player prefab (with a Player Input component on it) referenced.

When I press a button on a keyboard, or on a gamepad, a new Player is instantiated. So far, everything’s fine.

But if I click and move my mouse without releasing the left button, a new Player is created each frame !

This is some screenshots of my gameobjects :

Also, it seems that these multiple players instantiated didn’t have any device linked (there is no “Debug” in their PlayerInput component)… Maybe that’s why ?

I’m using Unity 2019.1.9f1, with the Input System Package v0.2.10

I’m also experiencing this. This only happens when I have a Control Scheme. The issue doesn’t happen when I don’t have any Control Schemes. I need them though to get the mouse and keyboard to work together :confused:

Are the devices used in those control schemes listed in the requirements? When control schemes are present, PlayerInput will entirely rely on the requirements on those control schemes to decide what to pair.

Does sound, though, like we have a case where the setup can lead to joining not resulting in the respective device getting paired at all and neither PlayerInput nor PlayerInputManager detecting the mismatch. Could you post your .inputactions file?

I’m not sure what happened, but I tried to recreate my setup earlier before sending my .inputactions and now it works. I think it helped when I only required the joystick (which triggered my movement) and kept the buttons (that switch between gamepad and twin usb gamepad) optional.

What requirements?

Each control scheme has a list of devices it requires (though some may be optional).

5593618--578161--upload_2020-3-16_12-3-50.png

You’re a bloody lifesaver. (Still having more issues though, but not related so I’m off to post a new post.)
Thanks man.

:slight_smile:

Sidenote… that screenshot makes me realize, we’re not even saying in there that the list there is a list of devices required by the scheme. Think that UI could use some tweaking to make this more obvious. I’ll have a look.

2 Likes

I had a similar bug which I solved, the problem was that if I connect my ps4 input device, and I choose gamepad binding instead of PS4 controller, InputManager generate 2 clones of one input. Just change gamepad to ps4 controller or xbox controller and works. :slight_smile:

Thank you, dude, was struggling with the same problem here and just came across your comment!