Regenerating Shields

Hi,

Im currently just starting out on UE4, Im following a tutorial on health bars/shields etc. Here is some of my blueprints which currently deal damage to my shield an then health.

Okay so what im wanting to do is when im taking damage to stop my regenerating sheild and delay it for 5 seconds. I have tried making the regen a function however it doesn’t seem to work. Can anybody help me?

Thanks in advance

Haydn

In the delay node you put in 0.5 instead of 5. Maybe this solves the problem ?

You should use the Retriggerable Delay to count the time until the regeneration starts. Because when it’s counting, you might take some more damage, and Retriggerable Delay will start counting from the beginning, whereas a simple Delay will continue counting from the the first damage instance and until it’s finished; so it may happen that you have suffered damage a second ago and your shield is already regenerating, because 5 seconds from the first taken damage have elapsed.

Another thing: don’t use Tick and Delay to regenerate: use a Timer. That will do the same but with no Ticks used. So the sequence I imagine is this:

  1. Damage is taken, the Retriggerable Delay starts counting.

1.a. If you’re hit while it’s still counting, it resets and starts counting from 0.

  1. When counting is done, you Unpause Timer by Handle. Armor starts regenerating.

2.a. If you’re hit again, you Pause Timer by Handle and start the Retriggerable Delay again, go to p.1.

So, Damage taken => Pause Timer => Start Retriggerable Delay => Unpause Timer. And the Timer’s event does what you have after the Delay in the Help2 screenshot.

This would be a good idea, retriggerable delays

this is HP, but will work the same for shields, Event StopHPRegen is called anytime pawn takes damage.

Looking back at it, that should probably be Retriggerable Delay.