If you decided use the New Input System with UI you can have some problem - UI wouldn’t react if you use your custom Input Assets.
By default when you create the Player Input component (by default the field UI Input Module set to None)
If you after that create the Event System (its create automatically if you create some UI element, by example - button), It have the default value in field Action Asset (DefaultInputActions).
In this case all will work fine, but you “Player Input system” and “UI Input system” will use different Input Action Assets (in my example, the “Player Input system” use the my custom BaseControl.inputactions).
More correctly use the one Input Action Assets and set the field “UI Input Module” (based on official docs - you must set your InputActionAsset in “InputSystemUIInputModule” and link it to your Player Input through the field “UI Input Module”)
BUT VERY IMPORTANT (its not writing in docs) you must have correct Control Scheme set for UI Actions (in your InputActionAsset).
You must whether no any schemes (as on picture below) or have right scheme which will activate Action as for your Player Input System and also for UI Input System.
I had problem then I set for Player Input System control scheme which used only the keyboard and its blocked any input actions to UI from mouse, because initial the mouse device was absent in my control scheme (You can set the used Control Scheme for Player Input, but for UI Input System you can’t do it, it use the same).
Thanks for these details, I think I am experiencing the same/similar issue. I have the same playerinput and event system components as you. I have two action maps, Player (for player movement in game), and UI (for UI navigation). I am trying to switch to UI when in menus, but it doesn not work.
Tried SwitchCurrentActionMap() function which does change the action map, but it still does not work.
What do you mean by “You must whether no any schemes (as on picture below) or have right scheme which will activate Action as for your Player Input System and also for UI Input System.”?
This is what I have setup for my action maps, for Player. How could I not use any control schemes here, doesnt it mean the player action map wont work?
You don’t show the your Action Map for UI, and what type of control scheme you use for Player and for UI. In the scheme you must enable the all devices which you use as for Player as for UI Input. (because at now the UI can’t use the separated scheme from Player)
You must not create any scheme or create the one common scheme for Player and UI.
What worked for me was that when you initially add your UI element that creates the initial canvas and event system, when you click the button to have it change the standalone input module to the new input system UI module, don’t touch anything, let it continue using the ‘DefaultInputActions’ that is shown in the InputSystemUIInputModule object when it is created, and you can still use a custom input actions asset for your player input separately.
If anybody else comes across this issue, my issue was that I LOOKED at the DefaultInputAction Control Schemes, saw that it was called “KeyboardMouse”, so I named my control scheme “KeyboardMouse” as it appears here:
If you EDIT the control scheme, you’ll see that it’s ACTUALLY named “Keyboard&Mouse”, but the ampersand (&) doesn’t show up in the control scheme name in the selection UI (lel)
To ACTUALLY fix this issue, you MUST have a control scheme named “Keyboard&Mouse” like so:
setup to use both the Keyboard and Mouse (otherwise the Player Input Manager will detect input from the keyboard and mouse as separate players.)
with UI action map copy+pasted from the default action map asset:
OH. MY. GOD. I’ve had this same issue for years and it’s been a constant thorn in my side with the input system. This one thing. This one fix solved all the problems I’ve had for YEARS. THANK YOU! Gah I don’t get how Unity releases things with such silly little bugs in their systems likes this.
Oh man, I spent literally 3 days scratching my head over this… I still can’t believe that the solution was to rename my scheme to “Keyboard&Mouse”. I feel relieved and super sad at the same time…
Thanks for this answer, I’ve been struggling with this for a while, it basically fix my issue except for a tiny detail that I think is something wreon that I’m doing, IDK exactly what.
Before this change I was not able interact with my UI at all, now I can except for the “Navigation” function,
If I use the same navigation control for UI and Player with " Keyboard&Mouse" I can’t move my player but I can navigate on the UI. But this onlu happen with the keyboard, the joystick works perfectly with the UI and Player.
Can any of you have face the same issue or similar? any idea of what could be happening?