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.
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.
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.