Health Resets on a Timer
Jigglebox
Member Posts: 63
Hello all,
I'm trying to implement a mechanic into my game where each time my actor "hits his head" he takes damage to his helmet.... I have successfully set this up with a game integer.
However I would also like to implement a timer. So if the actor doesn't hit his head on anything within 5 seconds, then his helmet damage will reset back to 0... But I want the timer to be able to be interrupted by hitting his head at any time and then restarts when he hits his head...
I've tried several different methods of this and i've come up with nothing useful.
Thank you,
Jigglebox
Comments
I would recommend taking two steps. First, create a true/false statement that triggers when he hits his head. I would recommend giving it, say, a half second timer that it switches back to false once it is true. And add a rule that "while HitHead is False and HelmetDamage <full" inside create a timer and uncheck Run to Completion. This means that the timer will start running as soon as the boolean shuts off, but if it turns back on, the timer will stop itself, and wait for the boolean to be false again before it starts back from the beginning.