When I have no schemes at all in the input asset, I can have multiple action maps that have actions that use the keyboard just fine. Then I can attach separate player input scripts on different gameobjects, and assign them different default maps.
However, as soon as I create a scheme with keyboard in the list, only one of the player input scripts works. the rest don’t even show what scheme/device they are using in the debugger! It doesn’t work whether I assign the schemes properly, or don’t assign them a default scheme (leave it as ), I can’t get it to work no matter what!
All I want is local multiplayer using the same keyboard. Arrows for one player, WASD for another.
You will need some manual code to set this up. The default behavior of the PlayerInput system is to assign one Input Device to each player - the use case being multiple gamepads for multiple players. It does this using Control Schemes, so it looks at the control schemes, and finds one matching the selected device, and will then turn that on. So, now your first player gets the Keyboard device, and your keyboard control scheme. If you add a second player, it will consider the Keyboard to already be used, and not assign the Keyboard device to the second player.
But you can manually set up what you want. Try calling SwitchCurrentControlScheme("myWASDControlSchemeName", Keyboard.current) on one PlayerInput instance, and SwitchCurrentControlScheme("myArrowControlSchemeName", Keyboard.current) on the other one.
And also, even if I have both players using the name control scheme, it stops working for one of them. Only if there are no control schemes at all does it work.
I’ve run into the same issue as this. Surely a second input should detect and assign the current input. Is there a way to toggle this off so that it can use the second players input.
Assigning a players control would seem strange as I can’t find anywhere where I can detect what input the person has