update viewport after respawn

I am working on a 2D Sprite Platformer, and when first spawning the HUD works just as it should updating the health, ammo and coins when you add or subtract. I am using a respawn on death, and as soon as the player dies and is respawned and then pick up ammo or coins it zeros the text out and won’t update until you load a new level or close the program. When exiting and coming back the saved data of ammo and coins are displayed properly again with even the extra amount that was picked up when it wasn’t visually updating.

Below is the code, the viewport is being called in the Game Mode Base, and the updates are being called from the Player Controller, and ending up on the Widget. Thanks.





I have managed to figure this out. Part of the problem was I was focused on updating the checkpoint blueprints and forgot to update the spawn player blueprints of respawn and my testing was before I ever reached a checkpoint, so no changes would ever show up in my tests… The fix was after respawning to call “remove all widgets” and then “update the hud”.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.