How can i die when my energy is 0?

Ihave followed Inventory UI with UMG tutorial series and i have made trought it and its working! I manged to make my mood and energy decrease slowly and now my proplem is how can i make health decrease slowly when energy is 0?
ihave changed health variable 0.5 for 100 and also i have changed mood and energy to 100.
if you can give me screenshot or good video tutorial i will be happy :slight_smile:

In the tick function check if your energy is zero and of so decrease the health with a small amount every time interval t.

hmmm i didn’t got it… can you screenshot?

and its also enough if i can die when ONLY energy is 0

No, I can not. Further, it is not a hard task. In the tick function of the character, check if your energy is zero and if that check returns true decrease the health with a small amount. You can do so by taking the number of health points you want to lose per second and then multiply that with delta time from the tick node. Then simply remove that much from your health.

but i don’t know how to build that…


or can i use this method? i think i need to replace jump action and those health’s to energy if iam right

Drag out the float and type = or equal. Then you get a node that compares two floats and returns a boolean if the upper input is greater than the lower.

You can use that method as well, but it is not required.

I am not in front of my UE4 PC so I cant show you an example.

when you can, can you give screenshot i belive its not hard to make but screenshot may help :slight_smile:

what is your “drain rate”?
if my max health is 100 and lowest possible 0?


… can you screenshot also that how to die after that… :smiley: