Why can i not get my game to quit when i press a required button on the keyboard?

Hello,

I have made a game that pauses the game when a trigger box is overlapped. I then have a widget appear and it says press the down arrow to quit to the main menu, among other things. However, when i press the down arrow in the game it does not quit the game. I have put below the blueprint as i am unsure what is going wrong:

I have ticked “Execute when paused” so i am still unsure why it wont work. Any help would be appreciated.

Sorry i meant the page down key not the down arrow.

No need to execute command. There is a blueprint for this

1 Like

Thanks for the response. I switched it to that but even then it still isn’t quitting the game.

Are you sure the actor in question is receiving input? If you add a print string between the keypress and the quit game, you can easily identify this:)

Hi HMan!

There’s no reason to worry about any actors, as this is on a Level BP.

Firstly, make sure this LevelBP is the one being used for the level.

Secondly, have you tried another key? Try using ‘Z’ or something if you’re not on a full keyboard ie. a laptop keyboard

On start you are clicking into the viewport, correct? Silly, I know, but I’ve done sillier.

I don’t know where else to point you, but I’m sure this will be a quick fix!

Gosh, that was an oversight😳 You’re ofcourse correct. Nothing to do with actors. Still getting it verified by a print string is usefull to see if the code is executed there in the first place.

LevelBP is third on the list of the inputstack for reference.
image

Put a breakpoint (F9) on the page down input event and see if it fires on keypress. Also try checking “Ignore platform restrictions”
To see this you also can’t be in the editor. You need to either:

  • run it in “Standalone Game” mode
  • pack the game and run the executable

I would also suggest not using predefined key inputs in the game. Better setup an input in the project settings and then call it’s event so it can be remapped in the future (direct is only suggestible for debug reasons)

1 Like

Are you consuming input for this key press in another blueprint?