A countdown timer binded to a randomly spawned powerup???

Does anyone know how to make a countdown timer attached to a powerup (or time up) unit that randomly spawned? I have this game like a race but you have to finish the map before time runs up. And throughout the map I want randomly spawned powerups that when you approach it, that will add time to timer. I want it to be randomly spawned because in every time you open the map it would be a different playing experience.

I made the game entirely in blueprint, no knowledge of C++ and my blueprint skills aren’t superior also. If anyone think how to do it or similar, can you show me? I found this post ( Game time - Blueprint Visual Scripting - Unreal Engine Forums ) but didn’t work.

When you hit your power up, you should just add whatever amount of time you want to your timer.
So, say, in your Player Pawn (or controller, or whatever), you have your main timer running. When you hit a power up, you read the timer value and add the power up time to it, and the counter continues to run.
I did this very quickly:
I added a timer to the player character:

And I made a quick Actor BP with this on it:

So, when my character overlaps the BP, it pulls the timer value from the player character, adds the power up timer value to the timer and sets the timer value.

Hope that helps!

Hello, the timer works! Thanks a lot! But I couldn’t make the powerup. What is that “Add to Timer” variable in the second pic? I only have get&set timer variable from my character BP. Anyway I just wrote random numbers that but it didn’t work:P. Also in this powerup actor BP, I put a sphere component set on “Trigger” in the collision. Is that right? Wrong isn’t it?:slight_smile:

And for last, how can I make this timer backward, as a countdown and set it’s font,size etc.? Thanks a million.

Are you looking for random time or random time and location?

Both. Random time and location. So every time player plays the game, one must manouver the craft according to that powerups.

I have seen a tutorial, that had a guy round around a level picking up spawns until a timer ran out.

If I can find it, I will paste it here.

Ok, from here ( How do I make a countdown? - Blueprint Visual Scripting - Unreal Engine Forums ) I managed to set a perfect UMG countdown timer. But now I have to figure out how to make additional seconds there with a pick up. I had some ideas but it didn’t work yet. If you or anyone have any ideas please write, thanks very much!

This is different, but spawns random actors for pick-up. You may be able to convert and add a random node for time.

Interesting! It’s logic is very similar to what I want. I’m looking into this right now. Thank you very much.

Here’s the solution if anyone needs the same that I did need. I’ve found this on answerhub.

You can create target points from the Modes window. Like creating a box etc. By the way, I did this in the level blueprint.

If you need to spawn blueprint actors like my project and not player pawn like this one, just add the blueprint to your scene and drag and drop it from the scene outliner to the level blueprint.