No video

How to build a Health bar for multiplayer in Unreal Engine 5 the right way - Tutorial

  Рет қаралды 9,060

LeafBranchGames

LeafBranchGames

Күн бұрын

In this episode we look at how you can make use of the health bar from my previous tutorial for multiplayer. If you run into any issues like you feel we breezed through parts without explaining, those explanations can be found in these tutorials I have done previously:
Link to health bar tutorial: • How to build a Health ...
Link to replication tutorials: • Tutorial: Multiplayer ...
• Tutorial: Variable rep...
Join the Discord server here: / discord
Support the work of LeafBranchGames on Patreon here: / leafbranchgames

Пікірлер: 60
@robertwilson1589
@robertwilson1589 6 ай бұрын
This here is EXACTLY what i was looking for. A dispatcher and replicated progress bar for multiplayer. You, sir, are amazing.
@LeafBranchGames
@LeafBranchGames 6 ай бұрын
Thank you kindly!
@x4loviGaming
@x4loviGaming Жыл бұрын
Finally something about multiplayer now i can know what is the difference between single game and multiplayer Edit : after watching i think i build my project the wrong way since i want it to be fully multiplayer sadly very very few YT's teach how to code for Multiplayer
@LeafBranchGames
@LeafBranchGames Жыл бұрын
The best resource available to understanding multiplayer and how it works for Unreal is this PDF: cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf I also already have some tutorials on multiplayer replication on the channel. Game development is a complex subject in itself, multiplayer on top of it makes it more difficult. But getting some basics of the flow can go a long way.
@jiggyspice6809
@jiggyspice6809 Жыл бұрын
What a great tutorial. I've been following so many half assed outdated unreal 4 videos and it was an absoluten nightmare trying to make it work for multiplayer with their methods. Finally someone giving clear and solid gameready sollutions. Please keep making multiplayer related tutorials, there are so very few of them and even less with clear information with someone that has a good microphone and actually good sollutions.
@LeafBranchGames
@LeafBranchGames Жыл бұрын
Thank you. Glad to hear you like it. :)
@muerrtee
@muerrtee Жыл бұрын
Thanks, i love anything related to multiplayer 👍
@LeafBranchGames
@LeafBranchGames Жыл бұрын
Glad to hear it. :)
@geoffreyfook9735
@geoffreyfook9735 8 ай бұрын
Thanks for the tutorial. I am slowly learning that multiplayer is not easy - for anyone busy developing a multiplayer game, beware of all the RFC stuff out there - it does not handle lag well at all when doing movements. It may look right when testing locally, but if you add some ping your whole game might fall apart. Learn how to test with ping - will save you time in the future!
@LeafBranchGames
@LeafBranchGames 8 ай бұрын
You are very welcome!
@rayloh8259
@rayloh8259 Жыл бұрын
Hi LeafBranch, i just want to say thank you for all your Tutorials. I made so many of them and i am still not done ;) Some of them i made twice to impliment it a bit different in my Game. So i can say that i learned most of my unreal engine skills from you. So thank you for that and continue your good work :D Best Regards Ray
@LeafBranchGames
@LeafBranchGames Жыл бұрын
I appreciate you telling me that, thank you for your support Ray. :)
@kevinsmith3348
@kevinsmith3348 8 ай бұрын
Thanks so much. Clear and concise tutorial. I tried making my own but kept having issues with the players sharing health. Thanks again!
@LeafBranchGames
@LeafBranchGames 8 ай бұрын
Happy to hear it was useful!
@EnricoPietrocola
@EnricoPietrocola Жыл бұрын
Great tutorial, aside from multilayer stuff I like a lot your use of event dispatcher and how tidy your code is, congrats
@LeafBranchGames
@LeafBranchGames Жыл бұрын
Thank you. :)
@KasimMeta
@KasimMeta Ай бұрын
thanks dod , the only right person explained that
@LeafBranchGames
@LeafBranchGames Ай бұрын
:)
@KasimMeta
@KasimMeta Ай бұрын
@@LeafBranchGames can you make replication system for press "shift key" to increase or decrease max walk speed of player please ? , all method on YT is say make two Event , one as server and second as client and run first on server and second on owning client but all of these methods is not working ,
@LeafBranchGames
@LeafBranchGames Ай бұрын
@@KasimMeta If you want to learn about multiplayer, I would recommend Bry from my "great unreal engine channels" playlist.
@KasimMeta
@KasimMeta Ай бұрын
@@LeafBranchGames can u send link please ?🤍 of that
@LeafBranchGames
@LeafBranchGames Ай бұрын
@@KasimMeta www.youtube.com/@LeafBranchGames/playlists
@AG-AYUSH-7
@AG-AYUSH-7 Ай бұрын
Thanks dude
@LeafBranchGames
@LeafBranchGames 29 күн бұрын
You are very welcome
@jefftehboy2840
@jefftehboy2840 Ай бұрын
Hi, Thanks for the tutorial it was really useful im just wondering if you would have any idea why my progressbar resets to default value and doesn't change after i destroy current character respawn new and possess. everything works fine on first life for both server and client but breaks on both on respawn a reply would be amazing many thanks
@pedinky293
@pedinky293 Жыл бұрын
i have a issue were the client works perfect but the widget server side wont update, the stings are there and accurate but widget wont change
@LeafBranchGames
@LeafBranchGames Жыл бұрын
Make sure you have done everything according to the tutorial. Especially the parts where we create, show and update the widget information.
@sohansuvarna1369
@sohansuvarna1369 4 ай бұрын
@leafybranchgames Thanks a lot for this amazing tutorial. I have also followed your card game tutorial. I need to know one thing can widget component/widget ref be replicated.
@LeafBranchGames
@LeafBranchGames 4 ай бұрын
You can replicate anything that is not on the local client. A UI element tends to only be relevant on a specific client.
@Hipnas
@Hipnas 6 ай бұрын
Thanks Leaf for a great tutorial, I ran into a little situation here. When I want to Set Percent, for my Progress bar but since I use Radial Slider the Set Percent node is only for progress bar's and it doesn't let me connect my radial slider variable to it. Is there a different node which I could use or a work around?
@LeafBranchGames
@LeafBranchGames 6 ай бұрын
When you have the progress widget in the editor, you can see all the properties it has and you can toy around with them to see what they affect. In the case of a progress bar, it is called percent. So you can bring your other widget in, play around with its properties and you will see which property controls it in the manner you want it to change.
@calabralarouski7791
@calabralarouski7791 6 ай бұрын
It says "Server Damage (Target is BP_Player Controller Replicated to server(If owning client))" how do i make it doesn't have the "replicated to server if owning client" like how it is in the video?
@LeafBranchGames
@LeafBranchGames 6 ай бұрын
If you follow the tutorial closely, you should not run into such an issue.
@Ed_Kass
@Ed_Kass Жыл бұрын
This way of implementing Health removes the need for using GAS to do it for multiplayer? I mean... The main reason I was using GAS is to have replicated Health and Mana for multiplayer... Using this health and doing the same for mana and such can "extend" the original way of your RPG tutorial for multiplayer?
@LeafBranchGames
@LeafBranchGames Жыл бұрын
You are not forced to use GAS to get multiplayer replication to work. The benefit of using GAS is that you have a robust system with a lot of features out of the box. The down side is that it might be a bit complex. But you can for sure do all of it yourself if you want to, like done here in the tutorial. Yes, this can be done for the RP tutorial series as well if you want to.
@梦羽星辰_821
@梦羽星辰_821 6 ай бұрын
after I clicking 1 and 2 the string is showing me the health can increase or decrease, but the problem is mine health progress bar it wont update aftter i click 1 and 2
@LeafBranchGames
@LeafBranchGames 6 ай бұрын
That means you have missed some part in the tutorial related to the UI updating. The fastest way to fix it would likely be to redo the tutorial since it is so short. But if you want a learning experience for why the error is happening, I would suggest debugging the issue.
@梦羽星辰_821
@梦羽星辰_821 5 ай бұрын
@@LeafBranchGames the Ui part all in the possess event right? i will check it again
@tazz1226
@tazz1226 Жыл бұрын
hey leaf, i think its not a good idea to cast to your character from the widget blueprint, as some characters can be really expensive to have in memory, and casting will create a hard reference, so if you could do a small video on the repnotify alone of the health bar, that would be great!
@LeafBranchGames
@LeafBranchGames Жыл бұрын
You are very unlikely to have a user interface without your main playable character available and loaded in memory.
@dhruvbajaj1054
@dhruvbajaj1054 9 ай бұрын
I am able to do this but in my game i want the health to be in sync so if player 1 loses health player 2 will also lose health. I am new to networking and Unreal Engine. Any help would be appreciated
@LeafBranchGames
@LeafBranchGames 9 ай бұрын
Not really a multiplayer specific feature. You just want to have one healthbar somewhere and have that affected by damage adn heals and then show the current status. All the other logic is the same.
@matheusvidal3537
@matheusvidal3537 9 ай бұрын
I need to know one thing about that tutorial logic.. why u're casting the TP Character on the HP widgets for multiplayer? because, if we're creating other characters to the game, we will have a lot of others characters BP, right? but that logic will only applies to one character. What is the correct way to do that, so?
@LeafBranchGames
@LeafBranchGames 9 ай бұрын
Characters with common logic can reduce code duplication through the use of inheritance. So the common class that has the health logic would be the same for all of them.
@matheusvidal3537
@matheusvidal3537 9 ай бұрын
@@LeafBranchGames Great! I could understand what u said, but I don't know about how this works... I'll have to do something for this inheritance? srry about anything, I'm not native speaker, so... haha
@LeafBranchGames
@LeafBranchGames 9 ай бұрын
@@matheusvidal3537 Inheritance is a concept within object oriented programming as a way to reuse code for classes that share commonality.
@matheusvidal3537
@matheusvidal3537 9 ай бұрын
​@@LeafBranchGamesLet's see if I did understood... In essence, I need to finalize this main BP_Character, which serves as the foundational blueprint for all others. By creating my actual character as a child of this blueprint, the HealthBar functionality should operate seamlessly, correct? This approach ensures that the HealthBar will continue to function for my subsequent characters, correct? I appreciate the clarification. Moving forward, I understand that for this I should develop all my new characters BP by right-clicking on this main BP already made and clicking on "Create Bind Blueprint Class", is that right? Thank you for your assistance. You have one of the best channel to learn gamedev
@tastyvegan1
@tastyvegan1 Жыл бұрын
My healthbar doesnt react when i press key 1 or 2, but i do get the print string, what have i done wrong at this point?
@LeafBranchGames
@LeafBranchGames Жыл бұрын
It is one of two things typically. Either the value is not being changed or the UI is not properly reacting to the value.
@Mr.K.Johnson.
@Mr.K.Johnson. Жыл бұрын
Hello, i do all thing like you in the tutorial but i don´t get the Progressbar work on clientside??? But the values for the health in the printstring for server and client are working correct!? What do i wrong?
@LeafBranchGames
@LeafBranchGames Жыл бұрын
Sounds like you missed something with the create UI on client event possibly. Make sure to do everything like in the tutorial.
@Dahvidownz
@Dahvidownz Жыл бұрын
I got this working before but now it only works on client and the server's client doesn't work. any ideas?
@LeafBranchGames
@LeafBranchGames Жыл бұрын
I would look at the events executing on server and replicating to clients. Likely one of them is incorrectly setup.
@nikohedegaard
@nikohedegaard 9 ай бұрын
Hey :) Great tutorial, been looking for a video on this for a while and i cant seem to get it to work everytime i press 1 or 2 my health gets set to 0 even tho the maths should be subtracting dmg with health even had this problem on my "Arrow overlapping" logic do you have any idea on what could cause this? :) watched the vid 3 times just to make sure i didn't miss anything
@LeafBranchGames
@LeafBranchGames 9 ай бұрын
Hello! Unfortunately, the short answer is that you missed something in the tutorial, I would recommend making sure you do every little detail the same as in the video. Or start with singleplayer HP first, and when that works for you - move to making multiplayer. It cna be something like default value not set, to a pin not connected, to having an incorrect reference. There are many different mistakes that could result in that effect.
@nikohedegaard
@nikohedegaard 9 ай бұрын
@@LeafBranchGames Cheers! :) Rofl okay i just found the issue so at "event anydamage" when i subtract damage with health i had damage on 1. pin and health on 2. pin never thought of that xD have a nice day mate :)
@matheusvidal3537
@matheusvidal3537 9 ай бұрын
How add ALL players health to the hud? like, If player 0 exist, show his HP bar, If player 1 exist too, show as well.. ... I'll search here How to make a team x team system with char select, everything in multiplayer. That's the thing I need at the moment
@LeafBranchGames
@LeafBranchGames 9 ай бұрын
It is exactly the same theory as in the tutorial. The difference is that your UI belongs to your controller and your pawn. That is not true for others. So you would need a reference to either all those objects/characters/actors you want to track, or just have your UI get fed that information whenever they change by a central class that keeps track of that.
@matheusvidal3537
@matheusvidal3537 9 ай бұрын
@@LeafBranchGames Thanks bro, love u. If one day u do a tutorial about it, I'll be happy 😁
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 61 МЛН
艾莎撒娇得到王子的原谅#艾莎
00:24
在逃的公主
Рет қаралды 41 МЛН
Son ❤️ #shorts by Leisi Show
00:41
Leisi Show
Рет қаралды 10 МЛН
How to Make a 3D Health Bar for your Enemy in Unreal Engine 5
6:43
Quick & Easy Multiplayer Replication in UE5 Unreal Engine
7:12
How to set up local/split-screen Multiplayer in Unreal Engine 5!
4:58
Multiplayer in Unreal Engine: How to Understand Network Replication
22:08
Make a Top-Down Shooter in Unreal Engine 4
1:52:39
Unreal Engine Tutorials
Рет қаралды 205 М.
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 61 МЛН