Widget HUD breaks on player death
Okay so the HUD, and the timer and Stamina gauge all work properly, at least until the player dies and respawns. The Stamina still works but the gauge remains empty, and it's like the timer numbers look like they're stacking on top of each other. I'm reasonably sure I'm only creating the Widget a single time. I'll link before and after example pictures of the HUD, and a picture of the code that spawns the player and creates the HUD. If there's any more info you need to help let me know and I'll post pictures of it.
asked Jan 13 '16 at 10:58 PM in Blueprint Scripting
Hi, Your HUDs are stacking on respawn, also, HUDs getting values from the Current Character Blueprint are bound to that Blueprint while in game. If the character dies, the HUD will keep tracking the dead character and not the new one. Basically, you need to tell your HUD that the Blueprint has changed.
Below is my 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.
answered Jun 05 '16 at 02:01 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here