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:
Now create a structure that holds the player values, being Health, Armor and Shield
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.
This is now a function that will adjust the player stats display.
This function calculates the new stat values.
In the event graph add a BeginOverlap event handler to the Collision box to take care of pickup removal after pickup.
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…
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…
In the final game it looks like this:
Hope that helps
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
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
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
Can you post some screenshots what you have so far (UMG BP and the player/pickup event graphs).
Happy to look into it