How can i make my character die?

i managed to make my health bar decrease after food decreases to 0 but now i don’t know how to make it die when its 0 health? it will help alot if you can give screenshot!

Hey,

So i’m guessing your health bar decreases due to a variable called “health”.

When health is equal to zero, or below zero, you will then want to get the player controller, get the controlled pawn, and then call the destroy method, or create a death method where you reset the attributes/ stats in the player state.

Then after a timer, or delay, spawn a new instance of the player.

If this sounds alien to you, I recommend you watching the YouTube tutorials that Epic has provided. It will help you learn than look at a print screen.

Hope this helps,

Mo.

can you screenshot…

it won’t work

did u asign variable health to a number?

I have a thirdpersoncharacter set up too and it wont die foe some reason. I had it working before but i had to redo everything and now it wont work. Its pluged up to the event tick and it prints death and destroy component works on the mesh but its still alive and searching and sliding on the floor.

Its like my destroy actor node dosent work anymore. I been looking for help as well.