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"

How Do I Make a Health Bar With C++?

I want to make a game with a health bar that is affected by weapons that I will add on later. I would like to use c++ for it as I want to improve on that instead of relying solely on blueprints. Can someone give a good video tutorial they found on youtube? I have tried but failed and really want to do this. Any help will be appreciated.

Thanks

Product Version: Not Selected
Tags:
more ▼

asked Apr 07 '18 at 11:37 PM in C++ Programming

avatar image

A Twizzler
6 3 3

avatar image GIGA-Money Apr 08 '18 at 12:59 AM

I am also curious.

avatar image Shadowriver Apr 08 '18 at 07:54 AM

What you want to be effected? You talking about health points or appearance of a bar?

avatar image A Twizzler Apr 08 '18 at 02:08 PM

I want it to change the bar based on a variable so I can activate a death animation later when I add it.

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

1 answer: sort voted first

Then you should not focus on heath bar, you should have heath variable and when you apply damage you do all series of checks like if heath is = or lower 0 player is dead and it should play death animation and such. Heath bar like any other UI should only read heath variable and display it's current state, nothing more. In general your game mechanics should work without any UI, UI is something extra added to game mechanic to control it but should not be center core of it in the way that if you would remove or disable UI it would not run and have any errors, it should be independent of it.

more ▼

answered Apr 08 '18 at 03:23 PM

avatar image

Shadowriver
37.3k 936 172 1117

(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