Energy Regen, Could anyone help break this example down i found online?

So im really trying to understand how this works and the components

But i cant find any examples online similar to this, could anyone help break this down and the node information and how he created the components?

Looks like he’s just using separate timelines to create regeneration functionality for health/mana/energy. All three lines pretty much do the same thing.

To make a timeline you can just right click in the graph and search for timeline, you’ll see an “add timeline” option. Doing that will automatically add the timeline component into your variable list. From there you can call functions on it like ‘play’, ‘play from start’, ‘stop’ and others.

Timelines run their update pin every frame, they are kind of like extra tick events, but you can double click a timeline node to edit various things (such as duration, and adding and editing curves to change a variable over time - which isn’t being used in this example). This page gives some info on how timelines can be used: Timelines | Unreal Engine Documentation

Basically in this example they’re being used as sort of extra tick events i guess. So each ‘tick’ of the timeline, it gets the world delta seconds (time since last frame) and multiplies that by the regeneration rate (which would be in units per second, so like 10mana per second or whatever). That then gets added to the mana pool. The ‘min’ node is there to ensure that total mana cannot go above a certain value (in this case the result of the node will be the smallest value, which will either be 1, or the current mana pool). So looks like mana cannot go above 1 in this example.

It then tests to see whether mana == 1, meaning, is mana bar full? If it is, stop the timer (don’t need to regen any more).

There are a bunch of ways this could have been handled, timelines are just one way. You could also just use the ‘set timer’ node and set a timer for a custom regen function to fire off every 0.5 seconds (or whatever you choose).

Hope that is helpful!