Download

How do I integrate the docs respawn tutorial and UMG UI Quick Start tutorial?

I am trying to learn how to use the engine, so I followed this guide to make my character respawn

https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/RespawnPlayer/Blueprints/index.html

and this guide to give my character a health, energy, and ammo system

It seems like stitching these two together should be as simple as calling Destroy Actor on Event Tick if health is <= 0, right? But when the character respawns, its health, energy, and ammo are all zero, so it gets stuck in an endless loop. Some experimenting showed me that the respawned character also doesn’t take damage from outside sources, but the original character does. I’ve been working on this for 6 hours now with no progress, so any help would be greatly appreciated.

Figured it out!!! I had to tweak the HUD event graph, so it would rebuild every tick. This kept the player character it referred to from being stale. It also showed me the character wasn’t being spawned with zero health. It just looked that way because the HUD was referring to the destroyed character. The reason it appeared to be stuck in an infinite loop was because when the character died from my environmental hazard, the action triggering for the player to stop taking damage was never triggered, so my new character’s health would go to zero and be destroyed. I hope this can help anyone who runs into this problem in the future.

That sounds like a lot of unnecessary work, when all you really need to do is to poke the new character at the HUD when the new character spawns (for example, in beginplay for the new character?)