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.
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.
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?
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.
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.
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.
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.