Reset countdown timer and apply times two damage every time countdown timer resets
What I am looking to do is every time my countdown timer which is set at 30, reaches zero, I want it to reset back to 30. Not only that but when it reaches 0, I want the player to receive damage and every time it resets and drops to 0 it will again apply damage and keep looping like that. Also every time it applies damage it will apply times 2 damage.
I will give an example.
My countdown clock is set to 30. When it reaches 30 I want to apply 5 damage. When the countdown timer resets and drops back down to 0 i want to apply 5X2 damage which equals 10. The next time it resets and drops to 0 I now want to apply 10x2 damage which equals 20 and just keep going like that higher and higher.
I have a screenshot but i know its completely wrong. It does what I want,but just one time.
I really would appreciate any help. Thanks in advance.
I'd suggest you the SetTimerByFunctionName node. It creates a timer, and you can make it loop.
You just have to create a function, then call this node once (only once) by specifying the function name and the timer.
For the "double the damage each time" part, I would do a class variable to store the number of calls of that function, then multiply your damage by this number.
Also, I saw you put a delay, then decremented your variable. You should have directly substracted "DeltaSeconds" from your variable, since "DeltaSeconds" is the time since the last frame.
Hope it helped!
answered Aug 13 '17 at 03:41 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here