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

I am also curious.

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

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

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.