Death Screen Widget Is Not Dissapearing.

Hello, i have a created a death/respawn system. When the player dies the death screen appears. On the death screen there is a button that respawns the player. The player is respawning just fine but the death screen is refusing to go away.

This is the script in my PlayerBP (branch is connected to an event tick):

This is the handle death function appearing in the above script:

This is the Death Screen function appearing in the first script:

And this is the button script (it has a remove all widgets at the end but that isn’t removing the death screen):

I’m pretty new to this so any help is appreciated!

Thanks!

Hello! Thanks for replying. I got a bit confused on what you told me, as i said im pretty new. Would it be possible for you to visually show me this so i can understand it better?

On tick, only check if health is below 0 IF the character is alive not IsDead. Once the character dies, set a bool IsDead to true. Otherwise you’ll be spawning many death screens, and calling this death code over and over.

Your respawn code will not RemoveAllWidgets IF the gamemode cannot cast to GamemodeMain. Add a execution pin from cast fail to RemoveAllWidgets.

When you respawn, you will also then need to set IsDead to false.

In the future I would also advise you move this death check code out of tick, and move it to a separate event that is called whenever your health changes.

You’re welcome.
I’ve updated with images.

Amazing! Just a question. Before you sent the images i fixed it by adding a DoOnce node. What will the difference be between that and the screenshots you sent me? Thanks for everything :D!

NP.

You won’t be able to die again if you have a DoOnce.

I did though. I tested it.