x

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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

healthbar / Progressbar not updating

Hello!

We're a group working on a school project, and we've fallen into a little bit of a headache. The problem is that the healthbar (progressbar) doesnt update on damage taken.

Here is a picture of the blueprints that are suppose to update it: alt text

Now, a few facts to save time:

The blueprint is written in the Character BP. The "HP Main" float has a value of 100. The widget (healthbar) shows up on screen. The character DOES take damage, and dies after X hits from the enemy.

Im really at a loss right now, and Im hoping someone can aid me in solving this.

Best regards, Mats J

Product Version: UE 4.14
Tags:
more ▼

asked May 31 '17 at 12:11 AM in Blueprint Scripting

avatar image

Jacobs89
12 6 8 8

avatar image Ruffhaus Games May 31 '17 at 12:18 AM

Is that cast working? If you plug a print string into cast failed does it fire that?

avatar image Jacobs89 May 31 '17 at 11:22 AM

I plugged a print string inbetween the Cast and Set Percent, and nothing happend. When I plugged it into Cast Failed it printed.

So I guess the cast doesnt work. However, I dont see why. I made a exact set-up for the enemy and its health bar, and it works just fine! So something has to be wrong with that exact cast ("Cast to W_HUD" on main character).

any suggestions?

avatar image Jacobs89 May 31 '17 at 11:23 AM

alt text

This set-up is on the enemy, and it works. Seems quite similar, doesnt it? :/

avatar image mrlz May 31 '17 at 08:54 AM

would it be nice if I suggest another way to create a Health bar?

avatar image Jacobs89 May 31 '17 at 11:24 AM

Yeah, any help I can get is muchly appreciated!

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

1 answer: sort voted first

A better approach is to go to widget graph > go to the bound function graph, from there do the same thing but instead cast to the blueprint where the player health is stored. And you should be just fine. This is the proper way to deal with a widget. In my example it is stored inside the character BP.

alt text

You also don't need an event for doing this. It will automatically update the health whenever it changes.

Regards.

widget.png (54.1 kB)
more ▼

answered May 31 '17 at 11:29 AM

avatar image

navid100
1k 29 14 46

avatar image Jacobs89 May 31 '17 at 11:42 AM

This worked perfectly. Thank you so much!

avatar image navid100 May 31 '17 at 01:07 PM

I'm glad I could help. Please set the answer as Resolved by clicking on the green tick below the answer vote.

(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