Open/Close a Menu with the same key

Yes I can open it with my Pause Button (Esc) and I can close it with the Resume Button, but I want it to close with The Esc Button again too.

Heres the current Blueprint: (I didnt change the Resume Button)

I actually have the suspicion that I cant press any keys when its in UI Mode. So that the Inputs are “closed” when the UI mode is activated. And only when I remove the UI mode with the Resume Button, I can press it/open it again.

You have to set the game mode to “Game And UI” not just “UI Only” as UI Only will not allow keyboard input. Hope that helps :slight_smile:

Hes but then my character is still able to move during the Pause Menu is opened. Is there any other node where i can stop the game but still keep the input?

This should work, you just need to pay attention that you need to use game and ui input mode, otherwise if its just UI, your inputs(key bindings) wont be registered.

239904-test5.png

P.S. forgot to add a node for pausing the game, hopefully you can figure out where it needs to be

Thank you so much, everything working great. Only thing/problem is that I need to press Esc twice to open the menu after I hit the Resume Button, when I use Esc to open and Esc to close everything works fine.

So when you press resume you can add another event to where escape input is. So you would only use the same code for opening/closing. To put it simply on resume button clicked cast to the blueprint where your opening logic is and from there get your custom event.

Create a bool “Paused” set it to true when the game is paused. In the movement code, before “Add Movement Input” put a branch that checks whether the game is paused. If it is not paused add the movement input.

I’ve done this before so i know it works. If you still have trouble post another comment :slight_smile:

Here’s a screenshot below

239939-capture.jpg

Hope this clears up any confusion :slight_smile: