How can I set a event about my character die?

I don’t how to use a custom event to let my character disable movement when the variable"health" becomes 0!
I saw the contentexample using the custom events and functions to call,I try the same way as they using,but no work.
How I can I do that,thank you.

Hi ,

I’m not sure exactly what way you’re using to reduce the health of the character so I’m not sure if this is problem, but it’s possible that the health is never actually being set to 0. It may be going straight from positive to negative numbers. Attempt using the less than or equal to ( <= ) node to check for the health being at 0 or below. This should set off that flag without an issue.

Hope this helps!

OK,now my health is reduced by 0.1 when hitting by a rifle projectile,I set my health as float that values 1.0,and when it reduced to 0,the progress bar of the UMG will reduced as well

Could you show me the rest of your blueprints or send me a copy of your project? The issue may be elsewhere, because from what has been presented, it should work perfectly.

sure,now all the problem is it can disable movement right now after I use <= on the variable.
But the problem is if I can use a problem like"event tick" or "event hit"some events that can apply this to be happened and disable movement.Just the event that let the engine know that my health is 0 right now and I have to be dead,for example,if I use event hit,I need to be hit again and go dead when my health is zero.So sort of the event tick that event that can run the function.
Here’s is the newest picture:

sorry,no"all the problem"in the first line,it’s “all it can do”

The problem could always be somewhere else. It is possible that ‘disable movement’ is being overriden elsewhere or is referencing something incorrectly. I cannot proceed further in helping you without more of your blueprint or more information to go on.

One thing to try would be to add a Print String node between ‘Die’ and ‘Disable Movement’ in the function for ‘Die’. This will let you know if the function is being called at all.

no it’s not calling,sorry,I don’t know why.But thanks for the help

If it helps, you could try running the game and while it is simulating, switch over to the blueprint editor. It’ll show the workflow of the nodes in real time so you should be able to find where it’s stopping and what the issue is.

Hi ,

Did you ever find the solution to your issue? In the meantime, I’ll be marking this issue as resolved. Please feel free to comment if you require more assistance and the question will reopen.