How To Make a Replicated Health Bar | Multiplayer | Beginner Blueprint Tutorial | Unreal Engine 5

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

Kekdot

Kekdot

Күн бұрын

👨‍🏫 My Patreon link:
/ kekdot
Download Project Files | Premium Tutorials | Courses
💦 Get our Game on Steam | Kekdot Center:
store.steampowered.com/app/14...
---
In this tutorial video I show you how you can make a replicated healthbar for your multiplayer game in Unreal Engine 5 or Unreal Engine 4 using only blueprints.
We take a look at how we set up the widget in Screen Space using a Widget Component inside of the character class, so that it displays above the characters head.
We then setup the healthbar widget using a progressbar and we use a binding that reads the replicated health value from a character reference to update the widget.
This is an easy and beginner friendly tutorial video.
🛒 Checkout our awesome Marketplace products and learn more about Unreal Engine:
www.unrealengine.com/marketpl...
#unrealengine #multiplayer #tutorial #healthbar #replication
---
Welcome to Kekdot!
👨‍🏫 Our Patreon - Download Project Files | Premium Tutorials | Courses:
/ kekdot
🛒 Our Unreal Engine Marketplace Templates:
www.unrealengine.com/marketpl...
👾Join our Discord:
/ discord
📆 We upload videos on a weekly basis
📰 Follow us on:
Instragram: @kekdotyoutube
Twitter: @kekdot
Reddit: @kekdot

Пікірлер: 41
@Kekdot
@Kekdot 7 ай бұрын
Hey guys, 👨‍🏫 My Patreon link: www.patreon.com/kekdot Download Project Files | Premium Tutorials | Courses 💦 Get our Game on Steam | Kekdot Center: store.steampowered.com/app/1487180/Kekdot_Center/
@GEK0dev
@GEK0dev Жыл бұрын
Man these tutorials are coming out like lightning! Keep it up mate!
@prismgod1904
@prismgod1904 Жыл бұрын
for the ones that using the 5.10 template, put the Event Beginplay program BEFORE the mapping otherwise it doesn't work
@Califibradu03
@Califibradu03 2 ай бұрын
Thanks have been struggling so much, could you explain why we have to do it before and not after ?
@yunusemremanap7426
@yunusemremanap7426 Жыл бұрын
i love you man
@fafatogames
@fafatogames Жыл бұрын
add this video to "Multiplayer playlist"
@DarkRodFR
@DarkRodFR 3 ай бұрын
You can replace append with format text : {life} / {maxlife}
@Rlador
@Rlador Жыл бұрын
@Kekdot Is it possible to somehow prohibit changing the size of the widget when the player's camera is removed. If the project has a player's camera with a zoom, and if it gets very close to 300, but the widget is very, very small. Are there any other solutions?
@Daniel-sn5se
@Daniel-sn5se Ай бұрын
After watching 10 other poor tutorials about health I cannot express how much I loved this. Top quality. Great habits. Clean code. Feels like porn.
@zakcook
@zakcook Жыл бұрын
Great tutorial, now what if I wanted this to be hidden on the owning player pawn and only be displayed on other players in the game? Currently it floats in the way of their aim/view.
@kevinsmith3348
@kevinsmith3348 5 ай бұрын
At possessed or Begin (or whenever you deem correct not to have the healthbar), you could Set Visibility and target the Widget component that you added to your ThirdPersonCharacter.
@waw4428
@waw4428 8 ай бұрын
Kekdot, did you try this with a login from lobby to game map? I tried this after your video on how to create and join servers, and it doesn't work. When the players connect to a lobby, on creates a server, then all others join, other players widgets aren't updated. Then I tried activating the widget when the second player joins (based on proximity) and it world perfectly. However, I'm doubting the stability of such choice. Also, any suggestion on making a dedicated server? Ty :D
@Wesley5n1p35
@Wesley5n1p35 3 ай бұрын
following
@Derknomicon
@Derknomicon 6 ай бұрын
I'd love to see a tutorial that covers a project that has different characters to choose from that are all children of a base character blue print. They all have their own specified health values that are different from one another and then have those values displayed and updated (via character hud/widget) depending on damage or healing taken during a match. I haven't really seen anyone else cover this specific topic thoroughly, if anyone else has please let me know.
@jesperchristiansen6019
@jesperchristiansen6019 3 ай бұрын
You can do this by making the CharacterRef a object reference of the parent BP, this worked for me at least :)
@hundsy5287
@hundsy5287 Жыл бұрын
How can I add the enemy health in my screen as a widget for multiplayer? like when I join in a session the other player can see my Hp on top right
@afterparty0069
@afterparty0069 11 ай бұрын
I’m trying to do the same thing, have you figured it out?
@DrastyAlimo
@DrastyAlimo 11 ай бұрын
How about for splitscreen coop and the health bar is at the top of the screen and not attached to the actor ?
@Kekdot
@Kekdot 11 ай бұрын
Simply have each player pull the other players character or player state ref (depending on where you save the hp) and then display that in the healthbars. In local couch co-op its even simpeler, just pull player character 0 and 1.
@DrastyAlimo
@DrastyAlimo 11 ай бұрын
@@Kekdot my problem is that the widget is rendering in the same position, I'm using the template rpg all in one from the marketplace and the widget is not only the health bar but the whole system like inventory, skill and pet system, but thanks anyway! I'll try it here!
@kevinsmith3348
@kevinsmith3348 5 ай бұрын
This method seemed to require modification for me. I had to add to the Begin process, Switch Has Authority, and cast the widget separately in Authority and Remote. Seemed to work for players then, however, can't seem to get the AI to replicate. Only the Server sees everyone health. The Client can see the Server's health but not the AI. If anyone has solution/tutorial, please let me know.
@VizibilityZero
@VizibilityZero 11 ай бұрын
In newer versions of ue5 when you validate get the Character_ref variable in the widget it returns invalid on the client. Not sure how to fix that. Widget progress bar also does not replicate to other players, any help @Kekdot ? edit: it looks as though the client is not getting validated when it loads in to the world, updated original question.
@cordellbriggs4984
@cordellbriggs4984 2 ай бұрын
Did you figure out what the issue was with this ? I'm having the same issue.
@VizibilityZero
@VizibilityZero 2 ай бұрын
@@cordellbriggs4984 I actually never did haha, have stuck to non-replicated projects for the time being
@cordellbriggs4984
@cordellbriggs4984 2 ай бұрын
@@VizibilityZero just figured out, that if I stuck the replication snippet before the input mapping on the BP_third person character it worked!
@VizibilityZero
@VizibilityZero 2 ай бұрын
@@cordellbriggs4984 huh interesting! I'll have to give that a shot next time! Thanks for figuring it out haha
@johndoe35717
@johndoe35717 Жыл бұрын
what about if you want to hurt the other person
@rifthaven
@rifthaven 6 ай бұрын
I followed your video exactly and only my Server seems to update the health number, if I click it on the client side it adds a second server text so its like Client 1: 100 Server: 90 Server: 90 Client 1: 100 Server: 90 Server: 90 Any Ideas?.. (: EDIT: Super simple, I didnt mark replicate in the health variable!
@rifthaven
@rifthaven 6 ай бұрын
Im going to reply here just incase anyone else has the same issue I was having: I use Kekdot's Top Down Multiplayer Ready system, the third folder, so I have to put most of my stuff in Client Controller etc rather then the Server AI Character for input commands etc.... What I had to do was drag the Server_AI_Character variable in order to get the Health Variable from the WB_HealthBar and then just drag the Server AI Character Variable into the Target Pin and it works as normal! TLDR: Make sure you put the Update_Health event inside the Client_Controller and use the Server_AI_Character variable to get Health variable if you use TopDownMultiplayerReadyReliable
@PPp-fg3ps
@PPp-fg3ps Жыл бұрын
At 05:30, the health bar suddenly became replicated without showing how it became replicated
@JikaiNoTsubasa
@JikaiNoTsubasa Жыл бұрын
Because each player is an actor replicated by default, and the widget is attached to the actor, so it appears, but the values inside the bar (like health) is not replicated, only the widget
@marineinrecovery1282
@marineinrecovery1282 Жыл бұрын
My health bar won't replicate. I have replication on, no conditions. I've restarted my system and tried everything I can think of, but I cannot get the health bar to replicate.
@o-super2744
@o-super2744 Жыл бұрын
Widget component attached to a Character are very very very heavy on computing. If you do a game with many units, this is not a solution.
@jeuxdz
@jeuxdz 9 ай бұрын
update on tick is the most thing to dont do
@Kekdot
@Kekdot 9 ай бұрын
Only depends on which logic you run on it. Essentially the entire game runs on tick. Particles, the 3D world, the standard character movement component and all it’s calculations. When you run Lean code then tick is no issue for modern day computers. Simply keep in mind that you should only run lightweight logic on tick if you have no other choice.
@yushkovyaroslav
@yushkovyaroslav Жыл бұрын
Only works client side. Especially the text. 0 Clue how it replicates for him and what he did to replicate the health bar. Still 0 clue how it works for him its basically witch craft in my mind... XD
@Kekdot
@Kekdot Жыл бұрын
Just watch the video lol. Do it step by step and you have a replicated healthbar, what’s not to understand about it? You testing properly?
@yushkovyaroslav
@yushkovyaroslav Жыл бұрын
@@Kekdot Yeah sorry, I think it's because of engine difference. I did some research + someone in your comments mentioned it's something to do with input mappings. If you do it after, it won't work. I was confused because for me it would only be client side. As in values are correct but visual can only be seen by the owner and does not update for everyone else (or is the same for everyone from owner perspective)
@PRiMezGFX
@PRiMezGFX Жыл бұрын
@@Kekdot A few people are having this issue including myself. The healthbar does not replicate. Can you recreate in a newer version of the programme and see if it works and let us know?
@lukelawrence1931
@lukelawrence1931 Жыл бұрын
@@PRiMezGFX @ Yeah that would be sweet...same issue here...Only thing I'm using a pawn and not third-person template. I'm not 100% certain pawns automatically replicate this kind of thing.
@PRiMezGFX
@PRiMezGFX Жыл бұрын
@@lukelawrence1931 Im unsure. I know that the health is replicating as the string and death animation is displaying this but its just the Healthbar that seems to be the issue.
Пробую самое сладкое вещество во Вселенной
00:41
СНЕЖКИ ЛЕТОМ?? #shorts
00:30
Паша Осадчий
Рет қаралды 7 МЛН
How to Make a 3D Health Bar for your Enemy in Unreal Engine 5
6:43
I went through ALL Unreal Engine Plugins, here is what I found
36:35
How To Make A Health Bar In Unreal Engine 5
15:19
Matt Aspland
Рет қаралды 73 М.
How to Set up Health and Damage System  - Unreal Engine 5 Tutorial
28:08
ОБНОВА В БРАВЛ СТАРС?!😱
1:35:07
TicTac
Рет қаралды 1,4 МЛН
ТЫКАЮ НА ХОМЯКА В AMONG US MINECRAFT!
21:57
EdisonPts
Рет қаралды 1,4 МЛН
BLAST Premier Spring Final 2024 Presented by Revolut: GRAND FINAL (BO5)
6:2:58