Health system question

Is there a right way? or a wrong way to make one? i have been doing some research and idk how i should go about this for my project
i see a few different ways to implement damage and things like that in blueprint. but i was wondering if theres a simpler way to do so
sorry still very new to UE4

You could do it like that:

Create a float var in your character bp - add a “any damage” event - connect the damage value from the event with a “float - float” and at the 2nd link your variable - now connect that with a set node (from your health variable).

Now you can add a apply damage node in another bp which you can activate when e.g the player touches a capsule.

After that the float variable will be decreased when the player walks into the capsule :slight_smile:

u sir are awesome, thanks for the quick response… now that i got that sketched out… time for a physics based weapon system lol

Yeah, fighter5347’s approach is what ive used to track life. Basically, a simple float on the blueprint with a public function that can take in a damage amount.

When you have more questions about that topic just post them in here. Here you can see some pictures of a complete setup: https://answers.unrealengine.com/questions/50367/how-do-i-set-up-a-basic-blueprint-health-system-fo.html :slight_smile:

can i assign the damage as a float? or is that something i can determine later? like when i call the any damage node from say… walking into a capsule it deals 50 damage… but if it walks into a square it takes 100, sorry still very new to this blueprint stuff… feel like im taking on the world blind folded and naked

sorry i didnt realize the damage was already a float from the any damage node… :frowning:

ok, so i ran into another problem and i hate to keep blowing up my post… but im out of things i think i should check so i figured its time to bother you guys.
i made the simple health… tied it into a UMG hud health bar, but it will only draw 100% or 0% there is no in the middle, heres a couple of pics
b907a6c9831076a5b3156954b86266d6315a9ae8.jpeg



61fd40c6f73f2256ea0e83c94c0f11f8652ea305.jpeg
24d258cc65c41af390bb83247ff556a198a5a17a.jpeg

The progress bar requires you to provide the value in normalized form (0…1), so make sure you’re providing the health value as HEALTH / MAXHEALTH.

Here is a tutorial that explains the process of creating a health bar: - YouTube :slight_smile: