How to make ui countdown progress bar

hi need your help.

I can’t figure out how to make ui countdown progress bar

There is a pawn class, when the player takes it, there is a countdown, after which it is destroyed, and I need to make a progress bar that the player saw it after how long it is destroyed.

taken from the game

1 Like

You have a progress bar widget and a function that takes the max and the current value to set the percentage:

Then, for example, you start a countdown with a timer:

2 Likes

Let’s begin with our setup. You will need a Widget blueprint with a ProgressBar (mine is named PowerProgressBar) Sizebox (Width Override set to the desired X value) and a text element parented to it.


Note that I’ve gone ahead and added a text binding to the text element. That will come into play later.


From here, we will create three variables, two floats to represent the total time the time is capable of being (called TotalDurration) and the current time left in the timer (called TimeRemaining), and lastly a bool for if the timer has reached ended (called HasReachedZero).

Please note that TotalDurration has been set to be instance editable and exposed on spawn.


Lastly, in the text binding we made earlier, we’re going to want to display to the player how much time is left. To do this is just simple text concatenation.


The end result will produce a flexible timer widget that you can use as you like by setting its duration in any other blueprint.

1 Like