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?
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:
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.
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.