How can i make a floating health bar on enemy?

I set random value for damage and now i can see that everytime i deal damage it substracts that portion from health and does exactly the same when i deal damage again but its like it substract from full health again .

Add me on Epic Launcher as a friend: DDraiman1990. Ill help you from there :slight_smile:

I had to set Health after “Modify Health” too… lol

I’ve accepted your invite :slight_smile:

I started from scratch and rebuilt this with a basic bar and finally got it working! :smiley:

Thank you for all your help along the way. I think I’ve got a bit of a better idea of how the ‘Cast to…’ node is supposed to work. Essentially, it seems to be saying ‘Get a reference for an instance of this blueprint’ and the ‘Object’ pin is a saying exactly which specific instance of that blueprint is being referred to. I think some of the problem comes from trying to work out how to get a reference to a specific instance. I had assumed that dragging out my widget from the side of the blueprint would create a reference to that widget component (i.e. the one embedded in the blueprint running this code), but apparently not. So perhaps my issue is not about understanding the ‘Cast to’ node, but in actually understanding more about how to get a specific reference for the ‘Object’ pin. The ‘get user widget object’ node looks like it’s going to be very handy!

Working on getting this going has helped me learn a lot and given me better problems to tackle. Thanks again!

You are welcome :slight_smile: if you ever see me online on Epic and want to ask something, feel free :slight_smile: all the best.

Great Solution! I’m doing something very similar, but I need the healthbar widget to stay the same size on the screen no matter how far away the character is. Do you know how I could accomplish this?

Thanks, I hope you get this.

I always find the solution right after I make a post.

in the widget component on the actor, go to the “User Interface” Dropdown there is a section called “Space”. Change it from “World” to “Screen”

Hello everyone. i followed this guide and although the health bar rotation works like a charm, i cant figure out how to apply damage and affect the health bar. if anyone has got it right and can help with the blueprints that would be great.

If anyone is confused
here tutorial