Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Pause menu opening and closing || On key down in widget

So I am making a singleplayer game, I want to make it so that if i press lets say escape a pause menu will pop-up and when you press the same button again it disappears. So I was searching around for something to help me with my pause menu and found a video by Virtus. Now it wasnt the video that helped me it was a comment by Keytotruth. He had a more efficient way to do the thing in the video (Which btw didnt work for me the things in the video).

Keytotruth came up with this: alt text alt text

Now this didnt work for me as you will see in my image, probably because of the "get key". You see, I used a different "Get key" as mr. keytotruth did, but i cant find the one he used so thats why I post this question because i can find it... (Yes I am very new to the UE4 landscape, but i know i did something wrong)

P.S. The picture I took does not have the Exec. pin plugged in, that isnt the problem, i tested it with but it still didnt work, also I made the widget focusable. alt text

Product Version: UE 4.21
knipsel.png (102.0 kB)
keysolu1.png (395.6 kB)
keysolu.png (378.9 kB)
more ▼

asked Feb 16 '19 at 06:58 PM in Blueprint Scripting

avatar image

1 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I think both of those ways are incredibly convoluted for something as simple as a pause menu if you know what key you want to pause and unpause your game. Here is a different solution. Be sure to check the box on the keyboard event (whichever one you select to execute this code) to have it receive input when paused.

alt text

pause-menu.jpg (174.3 kB)
more ▼

answered Feb 17 '19 at 05:19 AM

avatar image

Nebula Games Inc
5k 27 9 14

avatar image TheUnRealRipixel Feb 17 '19 at 09:13 AM

Okey, ill give that a try! Thanks dor the help Nebula, it means a lot!

avatar image TheUnRealRipixel Feb 17 '19 at 09:38 AM

Hey Nebula, I tried to copy what you are doing and came up with this. There is only one little problem, it doesnt work. When I tried to press P inside of the pause menu it didnt go back.

(I have put this inside of my player character blueprint, maybe that has something to do with it?) alt text

avatar image Nebula Games Inc Feb 17 '19 at 04:27 PM

What happens when you press P? Does it open up the pause menu? If yes did you make sure that you allowed "P" event to still receive input while game is paused? (See screen shot above, select the "P" event node and make sure that the box under the 'input' tab is checked to "execute while paused"

avatar image Nebula Games Inc Feb 17 '19 at 04:30 PM

Also I noticed that you placed your input to be "UI Only" this will prevent keyboard input. "P" is a keyboard event so it works the first time opens the menu and after that it will only accept input from the UI so basically clicking buttons. You can't do that if you want a keyboard event to toggle the pause menu. The whole point of having it "pause" the game is that even if you press a keyboard button that gives game input like W,A,S,D for movement, it won't execute while paused. So it is redundant to set input mode to UI only AND pause the game. Get rid of that node, make sure keyboard input is allowed for the "P" key while paused as I mentioned above and it should work fine.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question