How do I setup a Pause and Un-Pause system using Blueprint?

I have been able to setup a pause system where you press the escape key and the game pauses but the issue I am having is un-pausing the game.

In the details for the escape button I have it enabled to be used when the game is paused I just don’t know how to setup blueprint so when escape is pressed again it un-pauses the game. Anyone know?

The console command to pause is a toggle, maybe you need to call the same command as well to unpause. What are you using to pause it right now?

You need to use the same “Set Game Paused” node but with the “Paused” input on the left unchecked. You would probably need to feed in a value there that is the opposite of the current “Is Game Paused” state.

At the moment all I have is this in the blueprint which pauses the game.

The thing is I’m new to UE4 Blueprint so at the moment I have near enough no idea as to what I am actually doing in it. I have followed some basic tutorials online but I am a long way off from doing stuff on my own. It’s the reason I resorted to coming to this forum.

Do you know how I would feed a value opposite to “Is Game Paused” state?

Hi Raiden58237,

I provided an example of how I got my game to pause and unpause. When you make your two booleans, at the bottom left screen you can check or uncheck the “default value” which makes the variable true or false. For your pause button make sure to check “execute when paused”

Let me know if it works

1 Like

Oh my god. That is so simple. Thank you for showing your example. Appreciate it alot!

Your welcome

Thanks Isaac Nichols

Whenever I pause the game it only renders what was is view when the game is paused, whilst everything else is hidden/culled, so when I look around I see nothing whilst the game is paused.

This is good for development purposes as I can check the culling, but I need to be able to pause the game while still looking around and seeing everything.
Is that possible or should I look for a different tool?

I’m developing an Oculus Rift rollercoaster using a camera that is attached to a dummy that moves along a 3DsMax spline.

I am also looking for a way to resolve this issue of pausing the game while using the Oculus Rift. It makes for a very bizarre and even nauseating effect in the pause screen that I cannot keep in the game as-is.

Sorry to revive a very old question. I have tried searching to an answer to this for no avail. JHarshbarger or ChrFrauzig - did you manage to solve the problem where the game will not render correctly when paused and the HMD is then moved/rotated?

when the game is paused you are not really meant to look around and interact with it much outside of a pause menu hence the entire game being paused. If you look at games in general, when you pause you can’t carry on interacting with it. The pause system is meant if you actually need to stop playing for a certain amount of time or to change settings, save, load, all that kinda stuff. When you pause the game state it pauses all the rendering and all that. There isn’t really a way around it unless you are willing to setup some kind of custom pause state in C++ which will pause the game but continue rendering objects onto the screen.

I use the Oculus Rift at work with the Touch and when the game is paused we actually advise the user to take off the headset as you’re not meant to keep interacting with the environment.

One work around is before you pause it, everything gets rendered. Only problem is you will get a massive performance hit and I doubt you could maintain the 90FPS required to use the headset.

Sorry for the revive on a dead thread, but someone may find it later.

As an answer to the pause and look around bit, use Set Time Dilation and put it to zero. Movement will be disabled effectively, but looking will still be fully functional.

Thank you! Awesome!!! <3

275520-capture.png

Just to clarify the solution provided above. Since you’re using a flip flop, you can use the provided “is A” boolean to set the pause state directly.

2 Likes

It does not work in my PC, when I hit again the button it won’t unpause.

1 Like

can you provide more details or even a screen capture of your setup ?

A note to those using Oculus: If you’re trying to set the “Oculus button” (home button) as the pause, it is reserved, by default. I’m doing a check for “has input focus” to test when the Oculus pause menu is active. This is all done from an event tick. If anyone knows a cleaner solution, please let me know.

The main note is, if you’re doing the pause menu with an event check instead of a button press, the entire blueprint needs to have “tick even when paused” enabled in the class defaults.

on the P key event, set ‘Execute when Paused’ to true

1 Like

Because all image links seem down for me, i’m reposting this here for future reference

Basically, you want to feed the Pressed output Exec of your key/button to a Flipflop then both of the Flipflop outputs A and B along with the provided boolean “Is A” to the SetGamePaused function.

Also make sure the button is set up to Execute when paused.

1 Like