Health/Damage systems

So i hear that Unreal Engine 4 does not support scaleform so my quest is. How can i use blueprints to make a health bar?

I have textures and i have been able to figure out how to get them to show with Draw texture. But how would i go about getting blueprint to remove part of the texture when taking damage.

if anyone has any ideas i would love to hear them. :stuck_out_tongue:

There’s a great example included in the hud level, under the content examples. It’s basically a material tied to a float. I also suggest watching the networking blueprint tutorials, as they give a great foundational understanding of how a lot of things work in UE4.

I have looked at the example several times now and i just cannot understand it do you know of any tutorials that could help me understand it better.?

Hi Firezown - I too am distressed with the absence of Scaleform and even went as far as to try an implement CoherentUI but I am just not much of a coder and it is a bit pricey for me right now anyway.

I have found fractured tutorials here and there with bits and pieces but ultimately nothing to be overly excited about.

In a project I have been discussing on the forums one user seems to have done something similar to what you are referring to. have a look here:


In the second link there is even a video. Hope this sets you in the proper direction.

The ContentExample project might seem difficult, but its actually fairly straight forward once you realise how things are connected. All you need to look at is the HUD blueprint and the health bar material.

The material does most of the hard work; it basically draws your health bar from the maximum health with one texture, then colours in a percentage of it with the second texture, based on your current health. All you need to do then is let the health bar know your current health. I don’t have Unreal to hand, but I found this shot that basically shows you how to do that.

In here, its calling a function from your character blueprint to get the player’s current health (for testing purposes, you could just get a float/integer variable and set it to a random value below your max health). The important bit is the scale parameter and making sure that the parameter name matches the name in your material. This will tell your health bar how much health you currently have and thus give you your working health bar.

Taking damage is something else that you would set up to impact your health value in the character blueprint.

I have created a working experience bar which is the opposite of what you want but I just tested it by setting my experience to full and subtracting from it for the result you want. When I get home today I will write up a tutorial for both if someone else doesn’t help you by then.


Thanks guys, ill try these things later tonight when i have a chance to. And Hakabane i would love a xp bar tutorial and im sure alot of other people would too. :smiley:

Seconded! Would be cool to see that tutorial…


I poured concrete today with my dad so I’m beat, it will still be a couple hours yet but hopefully I can make something worthwhile that people can use and adapt. But I will write up a tutorial and post it as its own thread, similar to my item system.

just to show some basic screen shots:

edited for screens as an after thought

That looks really good, does the xp scale with levels?

Yes, there is a function dedicated to making the EXP needed scale with your level. With some really basic math you change it. For my base need though I just set it to increase by 500 exp per level.

Anyhow, I’m finally sitting down to write this up for you and everyone else who needs it.


Ok, Thanks looking forward to it :smiley:

Here is my new post if you don’t see it first.