Pause and Un-pause with Menu

So I’m trying to pause and un-pause the game. I can press P to pause the game. And click the resume button in the pause menu. But I want to be able to just press P or esc again to unpause it. This is what I have tried

But it doesn’t un-pause just by pressing P. I can resume fine via the resume button in the widget blueprint.

Which is as follows

Any ideas what I can do to get this working?

Again, I can un-pause fine when using the widget button. But not with an input action key.

Any help is much appreciated. Thanks in advance all!

And happy new year!

Disregard! Got help on discord.

I had set the input mode to UI only. Changing it to game and UI fixed this issue.

Also, you don’t need a boolean variable for is paused. You can just check if the game is paused or not.
Like so

You an also tag an input to work in pause mode by selecting the input node you put in your Graph and modifying a checkbox in its detail panel.