Pausing Game but allowing a timer to still countdown?

I’m trying to make a game where you have a set amount of time to beat the level. I’m trying to implement a 3 second countdown, where the game is paused before the round starts, before starting the round-countdown. I always want this when the player “Resumes” after Pausing the game. However, I can’t seem to figure out how to pause the game while allowing 1 timer to countdown and then unpause the rest of the game. Any ideas?

I managed to find this: UE4 Delays & Paused Timers - YouTube but I can’t see/understand what he’s doing to accomplish the “paused timer”.

Gonna have to bump this as this is essential to my game :confused:

Made a quick video to show you a possible way to achieve this. Delay’s still work during pause. So I looped a 1 second delay around and plugged it to a branch that checked if it was not equal to the desired amount of time. As long as it is not equal to the specified number, it will keep looping, once it reaches the chosen number, the branch states false and un-pauses the game. The Time variable is just a variable that I created and named Time as shown in the video when I created MyTime variable. Also, in my example, the pause and un-pause event is controlled with a simple key press and release. But this can be done in different ways.

Let me know if there was anything unclear! Take care!

I got it working using the “Delay-loop” you made for me - works like a charm!

EDIT:
I ran into a problem: when the level starts I want the countdown, as well as when the player pauses. I have got the Unpause timer working, but the BeginPlay countdown never get’s passed the first Delay; it’s a 1 sec Delay and it just says “1 second remaining” when I’m monitoring it. Having the game unpaused makes it loop, so it seems like the pause also pauses the Delay.

http://i.imgur.com/gu1JYOw.png

I’ve re-created the above sequence and was able to run it successfully. Perhaps a value somewhere is off or something is not connected properly, can you post an image of the entire sequence?

EDIT:Oh I see, I have been building this sequence inside of my Player Controller blueprint.
I just tried building this sequence inside of an Actor Blueprint and was able to re-create your problem there. So build this sequence inside of your player controller. You may want to add a short delay (0.1) between the Event Begin Play and Set Game Paused, to give the game time to spawn the game properly before pausing it.

Sounds good - I’ll try it when I get home :slight_smile: Thanks for the help so far; really appreciate it :slight_smile:

Works like a charm, thanks for helping out man :slight_smile:

Np, remember to accept the answer for tracking purposes :slight_smile:

I’m fairly new to blueprint and was curious as to how you would go about this after a button is clicked in a UMG rather than when a button is pressed and released.

Right now I have the ‘P’ button bring up a pause menu and then within that pause menu is a resume button. When the resume button is clicked is when I want the 3 second countdown to start. However I don’t know how to call the button clicked in the UMG in my character blueprint so that the timer correctly knows when to start. Any ideas?

Thanks!