I have two Action Maps, “Player” and “UI”. I’m using the Send Messages behaviour on my PlayerInput component. The Default Map is set to “Player”. The “Player” map has an action called “Interact”, and the “UI” map has an action called “Confirm”; both actions have a shared binding. When I press that key, the event for both messages gets called:
Does this mean that all action maps are enabled by default? If so, what is the purpose of Default Map?
A workaround I’ve found is to manually enable/disable the relevant maps in the Start() of my input handler (doing so in Awake() doesn’t work for some reason), which works fine but I’m confused as to why it’s even necessary. Am I missing something?
Hey! I have the same issue. I need to switch to the “UI” (non-default) map and then back to “Player” on awake to get “UI” to disable properly at start. I found a Reddit thread with other people with the same problem and fix; Reddit - Dive into anything . Would be great with some insight into what might be causing this problem. Anyone else having the same problem?
Just commenting in case anyone else encounters the same issue.
The solution in the reddit kinda worked for me.
Check if you have both the “Player Input Component” and the “Input System UI Input Module” (inside the Event System GameObject in the hierarchy) with different Input Action Assets. I set both to the same one, and everything works now.
I’m using Input System 1.11.1 in Unity 6 (6000.0.23f1 LTS)
I personally would be happy if manually enabling and disabling the relevant maps in start() did work, Ive tried that and unity just doesnt, it simply wont. is there something wrong with this code
the weird thing is, I have actions in the input manager using the same enabling and disabling code, and when I use those the code works perfectly fine, but for some reason it wont work in awake or start. How do I fix this?
In my own troubleshooting, I found that enabling other Input System components would enable certain maps without my knowledge:
The PlayerInput component enables the map set in the default map field, as one would expect. This is detailed in the documentation.
The InputSystemUIInputModule component enables any map used in any of its bindings, as one might not be as likely to expect… I could not find this in the documentation, but found that my own UI map would enable with this component.
All maps seem to be disabled by default, but these components are designed to enable the ones needed as soon as they are enabled. I would guess, if you’re using the Input System with two maps, Player and UI, that there is an InputSystemUIInputModule that is enabling the UI map and a PlayerInput component that is enabling the Player map.
What worked for me was manually disabling all maps in my InputManager in Awake:
foreach (InputMap map in playerInput.actions.actionMaps) map.Disable();