Close pause menu with a hotkey

Hi!

I made a pause menu for my game and it is working perfectly fine except one thing - I can’t close it with a hotkey.
I was searching on the forum and found the [topic][1] with the same problem without any answers.

Here’s my graph([high res image link][2]):

http://savepic.org/8359049.jpg

I found that the hotkey(escape) I assigned is working on closing the menu only if ‘Set input Game Mode and UI’ is used and the game is unpaused.

Is there some way to fix this?

  • Keep Set Input Game Mode and UI on. You really do not want to use Set Input Mode UI Only too much. It’s not really needed.
  • Next, on “InputActionMenu” key, click on it, and on the details tab, check on Execute when Paused
  • That should resolve your issue. However, your graph is a bit messy and convoluted. You should be able to just use a FlipFlop node for this for the Toggle of the Menu on key press.
  • Good luck!

Thanks! That worked out!

I was using FlipFlop at the first place, but I found that it is not working properly with Resume button in the menu. If I will use the button to close the menu FlipFlop won’t be able to know about it and will stay in the same state.

The only thing left - when I’m pressing on the blank space in the menu my cursor is disappearing for a second. Is there a way to fix it? I assume that it is because he’s changing focus for a second.

Ah, never mind. I figured out this by myself. Just needed to uncheck ‘Hide cursor during capture’ in the ‘Set Input Game Mode and UI’ node.

Well, you should be using Set Mouse Cursor (on,off) that will make it easier on you for the logic.

  • Set Game Paused True
  • Show Mouse Cursor True
  • Set Input Mode to Game and UI
  • OR
  • Set Game Paused False
  • Show Mouse Cursor False
  • Set Input Mode Game Only

Yeah, already did it. Thanks a lot, anyway!

Hey how did you get around the flip flip issue with hotkey and resume button?