Constant damage over time

Hi everyone,

I’m very new to UE4, and I’m trying to get use to it by creating a simple game: Your charactere lose health over time (5 per sec. for exemple) and you must retrieve medicbox to stay alive.
The thing is, I used tick event to apply constant damage, but it is not constant at all ! By varing the damage rate (see picture bellow), which is difficult because of tiny variation magnify the damage or cancel it, the health of the character will first reduce a little (1 damage per seconde) and then it goes crazy and deal 10 or 20 damage per sec.

Maybe there is a better way to do it, of I made a mistake. Tell me if you need more info. Need your help !

there is a much better way to do, use timers. basically if you use a timer then the event will trigger at a constant interval. the problem with tick is its based on the time between frames which isnt constant (if you have a framerate drop then the tick time will change).

the script in the picture below decreases the health every once second. it is basically the same as what you have above but it uses the timer to fire the decrement health event. it will fire over and over since i have it set to loop.

1 Like

Thank you for your answer,

I didn’t know that feature, it helped !