Hi, I’m packaging for windows but when I run the .exe there’s seemingly no way to escape the game other than ctrl+alt+delete and to ‘end task’. Why is there no ‘X’ in top right of window to close the game? Any ideas?
Thanks,
Adam
Hi, I’m packaging for windows but when I run the .exe there’s seemingly no way to escape the game other than ctrl+alt+delete and to ‘end task’. Why is there no ‘X’ in top right of window to close the game? Any ideas?
Thanks,
Adam
ESC is the default key in the editor, but there’s no such thing in a packaged game. You have to write it in yourself
You could make ESC work, or a quit button on the menu etc…
Cool I’ll look into this. Do you know how to do it? Guessing with a blueprint? Any links to tutorials very much appreciated. Cheers
Hi Adhills,
This is how I’d do it:
Hi Astrotronic,
Thanks for your help. I tried this but nothing seemed to happen. What might I be doing wrong? I opened the level blueprint, added the code, hit compile and closed. Any ideas? Cheers
Thanks. Hmm, I’ve now completed these steps but the escape key still does nothing.
When you say do it on the player do you mean as per shared image - set auto receive input to player 0. Or to actually place the code in a different BP class for the character?
I’m using the games>blank template btw, if that makes any difference?
Ok, if you don’t have a player character, then put it in the level BP
( you still need to enable input )
Strange this isn’t working. Maybe there’s something else I’m missing?
Ok…
Even if you put the code in the level BP, and enable input, you still need to click once on the viewport when running the game, before the ESC key will work.
Did you try that?
Hey, just tried this… still not working unfortunately. hmmm
So, to recap:
You put that code in the level BP, and have enabled input on the level BP. You can play the game, but ESC does nothing?
As an extra check, put a ‘Print String’ node after the ‘ESC’ input execution. If you’re not seeing the print string, you’ll probably need to set ‘Auto Receive Input’ to Player 0 (In the same Blueprint that you’re executing this input) like Clockwork posted above.
When you press a key, the input is routed either to a focused widget, a possessed character, or a controller. There is a certain order here, one of them is receiving the input and “handling” it. The entire input routing is much larger. Part of it: Docs of UE4.27. Might be different now that Enhanced Input is forced the new default on UE5.
Then the “Quit Game” node posted earlier will work. Keep in mind other platforms do not all support this.