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"

Health + Shield in one progress bar

How to create a health bar similar to this, which has both shield and health in the same progress bar. If the player does not have a shield, the whole progress bar is covered by health and if the player has a shield the x% of the progress bar is taken over by the shield and rest y% belongs to health. ![alt text][1] [1]: /storage/temp/258878-unknown.png

Product Version: UE 4.20
Tags:
unknown.png (10.6 kB)
more ▼

asked Nov 08 '18 at 06:17 PM in Using UE4

avatar image

User-436976881
1 1 2 6

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

2 answers: sort voted first

2x progress bars (or even borders, depends on what you need, really) wrapped with a horizontal box, with Size set to Fill:

alt text

The Size variable dictates how much of the parent space the widget occupies. In this case, the blue one has been set to take 25%, the green takes 75%.

When the player loses the shield, set the green to 1.0 and hide the blue. If you use a progress bar for the health, you'll have an option for the player to have a bit of health and a full shield, too.

capture.png (19.1 kB)
more ▼

answered Nov 08 '18 at 09:03 PM

avatar image

Everynone
10.9k 68 22 43

avatar image User-436976881 Nov 09 '18 at 02:51 AM

Instead of using two progress bars isn't it possible to do it using the material. alt text

It also has a shield in health and I don't think this uses two progress bars

unknown-1.png (10.0 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I would just use the "overlay" option. Create 2 progress bars, health first then shield so shield is always drawn last and over the health bar. In the shield's background style options, go to tint, set the alpha to 0. You now have 2 overlaid bars when the shield depletes it will reveal the health bar below. Each can be independently controlled with code/script to function however you like in your game.

alt text

more ▼

answered Nov 09 '18 at 03:20 AM

avatar image

Nebula Games Inc
2.8k 15 8 9

(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