Player Health going Below Zero

My player health keeps going below zero, I know to use clamp node but I don’t know where to put it, i would also like to play death animation for the player when the health reaches zero.

deathevent
this is in my charcter blueprint

getpalyer100
this is in the widget, it gets the numbers of my health


my player takes damge from this


this is in my widget blueprint


adds my hp to my viewport, its in character blurprint

this is the video of my character taking damage, sorry for the noise

I’d personally put it right after the True branch in the first image, so you know the player is dead, and then set health to 0.

You could also put it in the AnyDamage event, right before the set, clamp the result of the subtraction to 0. Since the death check is <= 0, it should still register fine.

ty so musch

You could also clamp your health values so they cant go below zero as well 951235b2de752b6998b6bd38dd33eeeb

Heres an example of that in my project im currently working on :slight_smile:

1 Like

it plays the death animation when the players die but then the reverts to idle pose and plays death animation again and the revive, how will I make it stop and and death widget screen