How do I make my progress bar decrease with integer-based health?

There’s no need to call this at all. We’re already setting the progress bar percent below… calling it will revert the bar to the incorrect value you had before :expressionless:

Besides, you’re pulling wrong value in that update (not the one after division). You can skip this completely. If you call it the way you do now, you will override the progress with this, as mentioned before.

And you can also skip setting up Enemy reference in the widget. There’s generally no need for that.

It’s much more efficient for the actor to push data into the widget.

I still don’t understand how to do damage the way I want to. My damage takes 10% of the enemies health regardless of how much health they have. If they have 1000 then they lose 100, and if they have 100 then they lose 10. I want to do 100 damage no matter how much health the enemy has. But with floats, it’s making me do 10% of their health instead of an exact number.

I’m trying my best to understand everything you’re commenting but I’m very new to Unreal and there are a lot of things I do not know how to do, or where to add things in :frowning:

Here’s a small project that does all that:

Right click deals damage. I wrapped things in functions to make it more reasonable. See if this clarifies things for you.

Image from Gyazo

Okay I’ll check it out

Yeah that’s perfect! Now I can change the amount of damage that the player does, and the amount of health that an enemy has :slight_smile: Thank you!!

Wicked! Thanks for the update and good luck with the rest.

I’ll try adding it into my own project tomorrow. It’s 2AM here and I’m getting tired.

I just finished adding everything to my project and it’s working nicely. Thank you so much for the help! There was no way I was gonna figure this out on my own.

Do you know how I could change the text widget on the health bar so that it displays the health in numbers rather than a percent? (For example, 750/1000 instead of 75%)

No worries. Glad to hear you got it to work as you needed.

Sending it again as I misread your message:

  • have the Calculate function format value as text, and return both:

336290-format.png

  • send both values to the widget:

  • widget receiving that data:


Image from Gyazo

There are many ways of setting it up, just following on the logic that was suggested before.

I will try this out and let you know how it goes. Although, I do have one question. Why do I input 1 and 324 for the minimum and maximum integral digits? What do those specific numbers do?

These are the default values and can be left as are - number of whole digits to display. If you set the first one to 3, you’ll see 001 instead of just 1.

Max fractional should be 0 unless you want see values after comma.

I set everything up and it’s working great! Thanks for the guide on how to do it.