How to create a basic health bar using C++?

Hi
I am trying to build a game in C++. But, I am having trouble finding a video tutorial.
Can someone tell me how to create a basic health bar using C++? Also, some info on how to damage the player with a fire would be helpful.

Creating a health bar purely in C++ makes little sense what i would suggest to you is create your health system entirly in C++ add some assignable MulticastDelegate on change to the health system and create a health bar widget in the editor which you can attach to the hud which registers itself to that health system and on change shows the current state.

For the delegate I would suggest something like that:
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnHealthChanged, float, currentHealthInPercent, float, oldHealthInPercent);

and as member variable:
UPROPERTY(BlueprintAssignable)
FOnHealthChanged OnHealthChanged;

To damage a player with fire I would use an overlap volume and while the fire is burning and the player is inside this volume you apply damage to the player.

there are callbacks to
OnComponentBeginOverlap
OnComponentEndOverlap
to find out when a player enters, leaves a volume.

Thank you for your response. This is my first C++ game. So the more details that you can give me would be extremely helpful. I have created games with blueprints but I am trying to create this game with C++. and I can not find either Unreal video tutorials or documentation on creating a HUD.

I believe that is because creating a HUD in C++ is more effort than its worth. UMG is very nice to use and easy for creating widgets. I have some tutorials (mainly for blueprint minded people where I modify and change progress bars in C++). I provide new nodes for use in blueprints but you may be more interested in looking at the source code to see how I was able to do certain things. If you are familiar with blueprint nodes, they are all functions available in C++ some just have slightly different names and you have to find the correct header files to use them. Anyway, below is a link to a bunch of nodes I made using C++ a few deal with progress bars specifically.

Have you looked at the UE4 Gameplay Ability System?

Epic provides an entire sample project that details how to use it. It covers a HUD system and damage to player with fire etc.:

Please look at this forum post.

https://forums.unrealengine.com/development-discussion/rendering/75779-smeshwidget-hardware-instanced-slate-meshes-thread?103821-Source-Pics-SMeshWidget-and-it-s-complex-UV-stuff-how-do-we-use-it=

It uses hardware instance meshes, which will come in handy if you plan to have 100 players in one viewport and they all have health bars.
Using UMG based health bars is OK if you have only few players, but the FPS will drop if you have 20+ players with health bars.

Please lets get it done, even I m trying to build a Plugin using this stuff and make use in my game and expose to other devs also.