Box Trigger To Add Seconds Onto Timer

How would i do the following: When i start the game a timer of 20 seconds should begin if it drains to 0 do a custom event. But i want there to be a box trigger which kinda fills up the timer again for example if the timer is on 14 and you stand on the box trigger for 3 seconds the timer should give 17 seconds. 20 is the most i want it to go to. Also i want a widget to automatically update kinda like a pizza if you take one and one slice out like this: Screenshot - a0f770017a19ff4959b29aff08401949 - Gyazo

Quick rough example I was talking about.

As for the pizza material, you can try something like this:

As for the time, you can use the timer as per Okarii’s example, or maybe:

I like Event Tick in this case, because it updates the material more smoothly. But timer is fine too, it’s up to you.

Two Recommendations for this. Look into the Retriggerable delay. each time you send information to it, it will reset its timer to whatever the float value you give it is and continue to delay.

The second is the set timer by event. for what your talking about your really wanting something that will perform an action often (update the visual timer) and then perform a specific action at the end of it. the set timer by event function would let you loop a particular action to occur say every .1 seconds, and then after so much time has built up, it will trigger something else and make itself stop looping.

Heres some documentation on the event timer: [https://docs.unrealengine.com/en-US/Gameplay/HowTo/UseTimers/Blueprints/index.html][1]

I’ll whip up a quick example bp setup here in a moment.

313523-set-timer-by-event.png

313522-retriggerable.png

313538-time.gif

It’s an example in the level, but you can do the same in a widget.

Using the event tick can work as well. I will bring up two nodes that may help should you go this route, set actor tick enabled and set actor tick interval. the event tick triggers every frame (by default) regardless, so should you desire to turn it off and on via blueprint these nodes help.

313529-actor-tick.png

How do i put it in the game like you did? An actor or? Also is this good? For The Pizza Example? Screenshot - 92aee7670d4a3c95de4b29cd12ac2eb5 - Gyazo

You need to swap R and G masks, otherwise the pizza will start from the side, not from the top. And change the material blend mode to Masked, because right now your Opacity Mask pin is inactive.

You probably want to use it in a widget. Set material domain to UI, and create a dynamic material in the widget:

And you can change the gradient radius and density to your liking. Everything else is pretty much the same.

Ehh i kinda changed my mind after seeing how good it looked in game in your gif above how did you get it in game?

It’s just a plane with the applied material, you can see the plane referenced by the level blueprint in my second screenshot above. It looks crooked because I had to put it in the corner of the screen to show the print screen messages.

Sorry i have worded this question all wrong the title should be: How do i make widget update with a timer. I use these bps for this The Main Character BP/First Person Character BP: Screenshot - 20e3f1b89779ce339acdc6a39944f570 - Gyazo The Box Trigger BP: Screenshot - 2ac3ac9d4a55aab4505957910a74225c - Gyazo And then the mat that i got help from you : Screenshot - f311ca6f610a792b1386f26f5bcc4f96 - Gyazo Where should i put in the plane reference?
Everything else i had already done before so the only thing i really needed help with was the widget even posting this question i just worded it wrong.

You can set the timer in the widget itself:

You can create custom events in the widget and control the timer through them. Once you create a widget and add it to Viewport, save it to a variable, and you’ll be able to access its custom events from the blueprint where you create it, like character blueprint or level blueprint, etc.

i think i might just delete what i have done so far and then just do the bps you have sent me.

It was in the level blueprint. You can do the same in a widget BP, but use your dynamic material instead of the plane to set the Threshold.

Where is this?`https://answers.unrealengine.com/storage/temp/313535-time.png

This is my material widget: Screenshot - 4773b072d1953898b4a9ab5782b637a3 - Gyazo
And this is my level bp: Screenshot - d5c9b61de081dd3e34df918eca40b50c - Gyazo
Does this look correct?

Seems okay. Does it work?

It looks like it works apart from the circle and that i also want a box trigger that is used to refill the circle. Screenshot - db69438ccd298c00d97524a4266d0f04 - Gyazo

Did you set TexCoord to be 1, -1?

As for the trigger, this part refills it:

Just create a custom event in the widget to execute it, and call that event when you overlap the trigger.

Ok so i found out that it actually drains but i have my time var set to 40 seconds but it starts draining the circle at 20 seconds why does this happen? And where is this picture above? I know it said widget but what is the need of the widget if i display it as an in game plane anyways?