On respawn hud stops working

Hello,

I have the following problem at the moment, if I play my project either in editor or launch the following happens after respawn.

This as you can imagine is not what I was going for and so I wish to know if there is a way that I can fix it?

I have added images of how my gamemode and character is setup for the respawn.
Now I’m pretty certain that it comes from that I use begin eventplay to draw the HUD widget which doesn’t get redrawn at all so it doesn’t get the new health and energy values.

Regards,
Senzerar

Hi Senzerar.

I had the same problem going a little back. My fix for it was to drag of the hud variable (in your case, HUD reference) and “remove from parent” before I “destroyed actor” in the character blueprint. Let me know if that helps.

Cheers!

Hi Van,

I just tried doing this, it removes the hud while the character is respawning however once he’s respawned the hud goes blank and still doesn’t fill the bars back with the values in the character blueprint.

Underneath you’ll find how I added the hud reference. Is this the way you meant?

Regards,
Senzerar

That is the same way I did it. If it is removing while respawning, it is working. There are two methods that might help here.

  1. Try adding a delay of about .3 seconds in between the event begin play and the sequence to ensure that you possess your character before the hud is created.

  2. Do you have your update hud functions attached to an event tick? if not, than it is required to give a constant update of the hud.

hope this works, Van

Hey Van,

Your first solution worked like a charm.

Thanks,
Senzerar

I know this has already been kind of answered but this question kept being the top result when I searched for my issue. It helped me understand my problem but didn’t have the exact solution for my exact problem Essentially, I had the same issue as OP since I pulled data from my Vehicle Blueprint and used it on my HUD, at respawn, the HUD kept track of the old vehicle and not the new one.

I used the Time Attack tutorial to build the basics. I figured others would probably have the same issue as I did since it’s a popular tutorial.

Below is my fixed respawn for a vehicle, spawning at the last checkpoint it crossed. My “EventDestroyed” is in my Vehicle Blueprint and Points to the Respawn Function which is in MyPlayerController.

Once my Respawn Event is activated, the first thing I do is kill the HUD (Remove from Parent). I then Spawn My new Vehicle Blueprint, Possess it. After it is clear that my new Blueprint is loaded up and I “Possess” it, I then recreated my HUD. Unfortunately, I have a few layers on my HUD so I had to set certain settings on the HUD as I recreated it.