Download

How to make a constantly decreasing variable?

I want to make the hp lower when I am in the box trigger. I have done OnActorBeginOverlap, but my hp had decreased only one time. Please, help me.

Event onActorBeginOverlap—>cast to mycharacter blueprint—target is player character, return value is Current HP variable. Set Current HP Variable to current value - assigned damage. Pull out a delay, set it for how often you want it to trigger, then feed it back into the Set HP variable. This will cause it to loop

Personally I would cast to a custom event in your player character setting a variable “inPain” or something from the begin overlap. Then a delay or timer that fires your reduce health variable, then you just set “inPain” to false on the end overlap

I also would take ZoltanJR’s route. But each one is a good choice. Thankfully there is always more than one way to accomplish what you want

InterptoConstant on event tick that decreases player hp.

OnBegin Overlap set desired HP to 0
OnEndOverLap set desiredHP to current HP

OnEventTick do interpto magic from current to desired. Wiith some speed.

Im using this method
http://i1380.photobucket.com/albums/ah198/Krzysztof_Kantoch/life%20reduction_zps7kopvqvp.jpg

Its basically an Bp that cast to player hp an reduce it every 0.5 sec i also have here some resistance to “fire” dmg.
works perfectly, and its easy tweakeable

N5Ng2V8.png
Try this