How can i make a health system and bar in the fps blueprint

I am trying to make a fps moba and obviously that requires a hud and most importantly to me right now a health bar so can anyone help me with this.

Many roads lead to Rome. This is one of them:

Create an enumerator that defines the different pickup types:
Enum.JPG

Now create a structure that holds the player values, being Health, Armor and Shield
Struct.JPG

Create a BP based on actor that holds a reference to a mesh and provides a collision box.
Also add a variable to hold the amount the pickup will give.

d5f93c903a2a6b7e435cac3d5cb70f7272dc69e5.jpeg

This is now a function that will adjust the player stats display.

This function calculates the new stat values.

e1c74506ab1959f097854e6f65d64dd160f83b68.jpeg

In the event graph add a BeginOverlap event handler to the Collision box to take care of pickup removal after pickup.

c243d8c53d398bde6765702e5b90ea9cd79313ca.jpeg
717ff82bf3304155e8a74cfddd1abe329057ebc0.jpeg

Now place some in the level. Set meshes for it. Tweak the amount values per instance, if you like. The pickup is done…

Now lets modfify the player BP. Add a Stats variable and create a UI on begin play…

a8983838a5a5c9a9976115d1a01468d0ede8bfdb.jpeg

The player is done. So lets finally create the UI

Create an UMG interface and add text fields/variables to it. Those are the ones the updatestatsdisplay function from above sets…
7e4fc38250e34d9c027320cbaf22ce4b2a3919f1.jpeg

In the final game it looks like this:
060f93b1ace831208a7de531dd0eead672153679.jpeg
e45c79d9c4c58bb6473c7ea173a60fc92b061006.jpeg
8ee1de3823d8eaba79616c48f1b5421fee17ed6b.jpeg

Hope that helps :slight_smile:

how do i make a pick up type?

That was step 3 …

KVogler,

That was an excellent no extras tutorial. I’m sure it will be of use later. I watched the YouTube one that also manages inventory and it felt all over the place.

Thanks!

thanks a lot, its great!

If this forum would have a like function, i liked KVogler´s MiniTutorAnswer.

Thanks for all the positive feedback :smiley:

It was really just stitched together on thy fly.
As an afterthougt, it might have been better if I had put the UI part moreto the beginning.
If people really follow the order, they might be confused in the Updatefunction as the variable getters for the Ui cannot exist (yet)…

i was planning on doing a full asset/game creation tutorial. I just dont have a proper microphone.
With all the headsets I tried so far, I sound like Henry Kissinger through a drive-in speaker… :rolleyes:

Great tutorial thanks! Nice and concise.

How would i display the health for multiple players on 1 screen?

Thinking local multiplayer sharing 1 screen e.g smash bros, tekken, mortal kombat etc etc.

Thanks :slight_smile:

Simmilar to the single player solution. In this case, each player needs a reference to the other players.
You would set a variable array with all players for that. Each player owns one of these lists.
The you need to add a function to the player BP, which outputs the current stats of that player (GetStatsData for example).
In the UpdateStatsDisplay function you just need to add more text variables for the otehr values.
The you use the references to the other players from the array and call the GetStatsData to retrieve the other player values.
Then you update the UNG text vaiables the same way…

Could you expand on that please? The main bit im confused with is getting the other players into an array and referencing them.

Im still noobish with bp, im more design oriented.

Wooops :o
@hobbitjack:
Your last post in this thread just slipped by somehow…
I still feel obliged to necro/answer thisone :slight_smile:

Can you post some screenshots what you have so far (UMG BP and the player/pickup event graphs).
Happy to look into it :smiley: