Adding a Value over Time

So I have a energy system within my game which was made by following the inventory tutorial on the Unreal Engine YouTube channel. Now I want to be able to add energy over time from when it hits 0 to a value of .5 and i want it to be a slow increase.

I followed this example for a starting point and instead of decreasing the value i just changed it to increase the value but I’m not sure how to really go about it.

This is what i have so far.


Delta time is estimated time between frames adding it up on every tick will make energy be 1 after 1 second. You can slow it down by dividing/scaling delta time by X number and adding delta times as you doing now. That X number will became “Time to reach 1” or multiply X with delta time and add up result of that instead of adding up delta time then X number will then become “Value increase per second”.

You can also use timers but those are not good for updating per frame.