Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Health "Bar" Number

So I a at a loss, I have searched for a answer for this. I have a Health Bar, but how do I have the HUD report the Health in numbers such as 78/100, etc. Any input would be great a B would be awesome....


Product Version: Not Selected
more ▼

asked Nov 15 '14 at 02:53 AM in Blueprint Scripting

avatar image

1 1 2 1

avatar image Posokhov Nov 15 '14 at 03:03 AM

Are your current health and max health numbers floats?

avatar image Nadragul Nov 15 '14 at 03:27 AM

Currently Yes...I am considering changing them to Integers. Is one better than the other? I assuming it would be better for it to be an Integer.

avatar image Posokhov Nov 15 '14 at 03:43 AM

Float is required for the most part.

Right click in whatever folder you want to create your HUD. Click User Interface -> Widget Blueprint

Once in there, place a Progress Bar. Down at the "Appearance" level, there should be Percent. Click to create a new bind for that.

alt text

(Ignore the Health Percentage thing above; I changed my graph to show you how I'd implement it. My Health Percentage is calculated in C++ Native Code. Also, ignore the typecast from Integer to Float.)

The cast is to my character type.

How do you set owning pawn?

alt text

This is in a regular blueprint. There's probably a cleaner way to check. In Game HUD is my regular HUD.

Lemme know if that worked.

avatar image Nadragul Nov 15 '14 at 03:56 AM

I already have a Progress Bar, I have a functioning HUD. What I want to have happen is to replace the Progress Bar with Numbers:

Full Health: 100/100

Take some Damage: 69/100

Take more damage:



Does that make more sense?? I guess I need a "tickng" or counting health bar.

avatar image Posokhov Nov 15 '14 at 04:19 AM

Oh, so something more like what is pictured at the very top of the screen (ignore the overhead in-game part) alt text

This is how I set that up using similar nodes to before:

alt text

I added that as a binding on the Content>Text function of a text block.

avatar image xSAPZx Mar 12 '19 at 09:22 PM

how do i make this not show a decimal?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

If you just want a health value displayed there is no need for a "bar" of any kind. Why clutter the interface? Simply create a text box to represent the player health and have a binding or a function that updates the text within the box to display the player's current health. So you can create a horizontal box with 2 text boxes inside. The first check the box in the upper right hand corner of the widget designer to make it a "variable". The second text box you can hard code to the player's max health or 100 if it will be a percent. Then simply update the first text box (the variable one) to equal player health through a binding or a function.

more ▼

answered Mar 12 '19 at 11:51 PM

avatar image

Nebula Games Inc
5.4k 28 9 14

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question