x

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"

Problem with pausing/ unpausing game

Hello community, got a little problem here. I want to pause my game by pressing Esc- key and also showing a widget (Pause Menu). By pressing Esc again, the widget should disappear and the game should continue. This works for the first time, however it doesn't work afterwards. So when I press Esc the game pauses and the widget is shown and when I press Esc again the game continues and the widget disappears, but when I press Esc again nothing happens and I don't know why. Here is my blueprint code: alt text

Product Version: UE 4.21
Tags:
blueprint.png (407.6 kB)
more ▼

asked Jun 08 '19 at 01:49 PM in Blueprint Scripting

avatar image

Sergeant Razer
10 1 5

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

1 answer: sort voted first

you'd have to set the pause menu variable to a null value when you unpause the game. A null value is just a 'set' node without anything being set.

right now the variable going to be valid after the first press onward.

or you can use a flipflop node.

more ▼

answered Jun 08 '19 at 02:59 PM

avatar image

IndieGameCove
1.4k 11 4 10

avatar image Sergeant Razer Jun 09 '19 at 12:03 PM

And where do I connect the 'set' node to? I mean where to place the node? flipflop node would work, but I have to check whether the widget is shown or not and I can achieve that with a isValid node.

avatar image Araan95 Jun 09 '19 at 06:29 PM

Hello,

I can achieve that with a isValid node.

Actually you can't, because your widget reference will still be valid since "Remove from Parent" doesn't destroy the widget ref. It stays in memory, so your "is valid" will always return Valid since you spawned your widget once.

To fix this, you can just Set your Widget Reference right after "Remove from parent" and set it to none (just leave it empty), now your reference will be "invalid".

avatar image Sergeant Razer Jun 09 '19 at 11:10 PM

that really fixed it, thanks!

(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