How to create a continue screen?

What I’m wanting to do is have a “Continue?” screen pop up with a 10 second countdown when the player lives counter is less than or equal to zero.
If the start button is pressed (and there are credits in my case), then the continue widget will vanish (and the game will un pause) and the player will respawn with a new set of lives. However, if start is not pressed in the 10 seconds, then the game over screen will show.

Here is what all I did and maybe you can tell me where I am going wrong here. I created a widget called continue, wrote the text in one block, and made a bottom text block for the timer.

I created an integer in the third person character and set its value to 10.

In the third person character I added the widget and added to view port whenever the player’s lives counter read zero (I have another small issue with that you can read about here ) also created an Event Dispatcher that will fire in another BP when needed.

Per the advice of others on this forum and my own experiences, I decided to start using “dummy” blueprints. These are simply actor blueprints that have no mesh, yet contain code in their event graphs. The blueprints can then be dragged in and dropped in a map and thus they will execute if and when the map is ran. I made a dummy bp called “InsertCoinStartGame” I added the following code.

Added this code in the “bind” of the widget.

The widget does infact appear when I wanted it to.

However, there is no countdown timer. And I’m not sure why it is not working. I’m seem to have a lot of trouble with widgets showing live number changes on screen for some reason. I have watched many tutorials, not sure why this is not working. Any help is appreciated, thanks!

not sure why this is not working

  • bind once, not every frame
  • fire timer once per second, no need to fire it 1000 times per second only to delay and flood the latent system
  • you could do the countdown inside the widget itself, dramatically simplifying the whole thing

I’d like to think that the entire script could be replced with:

Directly in the widget, no need for a dummy actor.

1 Like

I put that code in exactly within the widget’s event graph.

Yet still it doesn’t count down, :frowning:

Thanks though, any ideas why its not counting down?

That variable is set to a 10.

bump

bump , help me Angry, you can do it!

It’s set to 0. Compare it to mine.

Either use a default only and do not override it with a node, or override with 10, not 0.

Ok I see now, you just typed it in directly to the variable.

But would you believe me if I told you it still is not working? lol seriously . I tried directly typing it in first, and then also reset the default to zero.

1 Like

Do you have a binding in the text? If so, remove it.

Negative.

For this not to work, there must be something else happening we do not know about. My suggestion is: make a new widget, add it to the screen:

That’s pretty much it when it comes to a countdown.


Perhaps something uncanny happens when you add it to the screen? Something overrides the variable elsewhere? Hard to tell.

1 Like

Yes I do think something else is happening we do not know about. I made another widget and used the original code and it still didn’t work.

And then the simpler code, and I know you can do that with a decriment node (not needing a set) cause I have done it before.

But if I can see the widget, then it must just be a problem with the variable. But then, the variable is freshly made and exist only inside THIS widget, nothing else is messing with THAT variable, and self contained timer as well. This just doesn’t make sense… Well shoot, I will mark this question as resolved because I do believe it should be working and you did try. If I do figure it out, I will bump this thread.

something uncanny

Your game is paused.


Delays couldn’t care less about that so, in this very case:

2 Likes

Angry you got it! Wow I never realized that the pause game would effect that. In hind sight it is kinda a “duh” moment lol. But…it seems when it begins it starts at 9, I never see 10, oh I think I know now…its that 2 digit thing in the two text. Thanks again Angy!

Help me Angrynone! You are my only hope!

That’s why I underlined the var set to 11 :smiley: Or decrease it after the Delay.

1 Like

Yes that is what I had to do, set it to 11.

Here is the final, on blueprint ue.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.