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"

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?

Product Version: Not Selected
Tags:
more ▼

asked Mar 08 '15 at 12:53 AM in Blueprint Scripting

avatar image

Busymonkey
25 4 4 9

avatar image Busymonkey Mar 08 '15 at 11:34 AM

I managed to find this: https://www.youtube.com/watch?v=jUiqm5HanCw but I can't see/understand what he's doing to accomplish the "paused timer".

avatar image Busymonkey Mar 08 '15 at 10:19 PM

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

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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!

more ▼

answered Mar 09 '15 at 06:43 AM

avatar image

Mortusnyte
911 45 19 77

avatar image Busymonkey Mar 09 '15 at 03:06 PM

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.

Delay

avatar image Mortusnyte Mar 09 '15 at 07:24 PM

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.

avatar image Busymonkey Mar 10 '15 at 09:22 AM

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

avatar image Busymonkey Mar 10 '15 at 03:21 PM

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

avatar image Mortusnyte Mar 10 '15 at 05:15 PM

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

avatar image Lowpology825 Mar 29 '15 at 09:09 PM

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!

(comments are locked)
10|2000 characters needed characters left
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