I Want to Be Able to Unpause Game with Same Button Used to Pause It. I Tried to Create a Blueprint, But It Doesn't Work

Hello,

I’m attempting to make it so that the same button to pause the game is the same one that’s used to unpause it.

I have a blueprint here and I can already see the problem being that it’s not actually indicating whether I press the button a second time, but, how do I do that then? What should this look like?

The game can still pause and the menu functions perfectly, I just can’t figure out how to make it so that pressing it a second time exits the menu, while also resetting it so that I can pause it again.

I’m also a beginner at this, so, I don’t know much of the terminology or functions yet.

Help would be appreciated.

in the script you show the reference you are using is wrong. basically you are creating the widget then when you try to get rid of it you are creating another widget and destroying the new one, put simply you create 2 widgets and destroy one for a net of one. what you need to do is to have a reference to the first widget you create so that you can later destroy that one. to do this you may want to select the return value pin on the create widget node and promote to variable. another issue you may also be having is that you need to select your input event and make sure that it can execute when paused.

1 Like

That seems to MOSTLY accomplish what I want, as I can pause and unpause the game now, but, the pause menu itself isn’t showing up.

Here is my blueprint.

Not sure what I missed (but I’m guessing it’ll be obvious).

Nevermind! I just had to add the view port! It works! Thank you!!

yea opps forgot to add that node but glad you got it working. also note that by using the is game paused node even if you use another means to close your menu or unpause the game this button will still work since the is game paused node gets the pause state built into the engine and not a bool you set yourself.