Ciclying ActionMaps with Actions with the same binding path triggers event on the new one

2 ActionMaps have the same binding path (key) defined for some action. Only one is active. When disabling the old ActionMap and enabling the new one, the event (button press) triggers for the new ActionMap, even with Initial State Check disabled.

My use case: I have a map and an ActionMap that handles when user is open the map. Player should press M to open the map and press M again to close it. When Player press M, I enable the map Canvas, this will enable the Map ActionMap. Since there is a callback already set for the Action to close the map, it will be triggered, closing the map again.

Same thing happens if enabling/disabling is done inside the callback instead of OnEnable/OnDisable

This happens with Unity 2021.3.19 and Input System 1.5.0 (also tested on and 2021.1.28 and 1.3.0)

8829937–1202296–TwoActionMapsSameBindingBug.unitypackage (20.8 KB)

1 Like

After more testing, this seems to only happens with perfomed event, for the button action type. started or canceled doesn’t seem to leek from one action map to another.

1 Like

Same here with Input System 1.5.1 and Unity 2022.3
I thought it was because the controls shared the same name. But from your example it’s likely because they share the same control.

Changing they control ActionType to Button from PassThrough helped.