I’m just getting into CommonUI right now, and I have my pause menu working as intended almost.
On the Enhanced Input for the player controller, I press ESC and it creates the pause widget, which contains a common activatable widget stack, with the pause menu, a common activatable widget, set as the Root Content. It opens and assumes control.
The issue is, now ESC, which is bound to my Back action, won’t fire on the player controller to close the pause menu.
The intended effect is: as a player, ESC opens the pause menu. If the pause menu is open and we’re on the root of the stack, ESC should close the pause menu. If there is anything in the stack, ESC should do the commonUI back handler action.
When opening the pause menu, do you disable the controller input and/or pause the game?
If you disable input, the controller won’t receive input anymore, which is obvious. In that case, you can use the input action in the pause menu itself and do the stuff you need.
If you pause the game, by default input actions are not triggered when paused. To fix it, open the input action asset and check the Execute When Paused box.
The actions are getting called on pause. Pre-CommonUI they worked just fine, its after adding ESC as the “Back” input for CommonUI that the activatable widget consumes all the inputs.
As for changing inputs, I set the menu to Game and UI while in game its Game Only. I never use UI Only because it removes gamepad and keyboard input.
I realize now in hindsight that its one of those common fixes I hadn’t tried, but I never understood it until this issue.
It does necessitate custom checks for keys and conditions but in the end that might be a good thing. Prevents wayward inputs. Over the last few days I’ve really pressure tested this fix and it seems air tight.