Health System for Player + HUD

Hey guys!
I have been playing around with Blueprint recently and I have been trying to learn how to create a Health System for player and also impliment that health system within HUD. I have had little success myself in attempting this so far. I have followed a HUD Tutorial on from TeslaDev so I have been able to get something to appear on HUD when I hit a trigger but I would like a HUD that is constantly there showing players health and does not dissapear when I enter or leave a trigger. Obviously I would like things to appear on HUD when I hit triggers but I already know how to do that. For time being I would be happy with a simple health system appearing on HUD but do have plans on expanding later on so if any of you guys know how to impliment something like this then please help me. I have left screenshots of what I have achieved so far with trigger HUD.alt text

Hey Raiden,

You can see a working example of a simple HUD created in Blueprints in Content Examples sample project. Open that project and then open Blueprint_HUD.umap level. You can read a bit about how it works here:

https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/Blueprints_HUD/1_1/index.html

main thing to take away from this is that in your Game Mode’s HUD Class Blueprint, you want to have your Draw Text node to come off Event Receive Draw HUD node directly if you want it to appear all time. As you have it now, it is only called when Gate is open, which only happens after Begin Overlap calls Show Text event.

Hope that helps! Let me know if you have more questions.

Excellent! Thank you. I completely forgot about example blueprints in Content Examples. Thanks again!

I don’t suppose you would know of how I would change it to work on a number system rather then a health bar?

I’m not certain I know what you mean by a number system. Can you describe it a little more?

So instead of a health bar I have it say Health: 100

If i remember correctly, Healthbar uses ScalarParmater to scale it from 0 to 100%.
This scale depens on Health of character. So, you must have a variable that is changed. I guess it’s just called “health”. Look what variable is changed by healthpickup.
So to have numbers instead of texture, just use Drawtext Node and plug health variable from your character to it.
Remember DrawText can only be used in your HUDClass. You need to get player Character, cast it to your CharacterClass and get Health Variable from it, all inside HUDClass.

As eXi mentions, you would use same variable, Health Value, and just plug that into your Text input on Draw Text node. Using setup from Content Examples map, it would look like this:

Thanks guys for your help! I really appreciate it.