How to build an enemy Health bar in Unreal Engine 5 the right way - Tutorial

  Рет қаралды 5,285

LeafBranchGames

LeafBranchGames

Күн бұрын

In this episode we look at how you can create a health bar for an enemy that makes use of the same system as your player.
Aign mesh to camera tutorial: • Align Mesh to the Came... by @RVillani
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

Пікірлер: 50
@artemaung5274
@artemaung5274 8 ай бұрын
There's a bunch of tutorials about this who all do this badly, yours is the only one I found that shines the light on this. Cheers mate!
@LeafBranchGames
@LeafBranchGames 8 ай бұрын
Thank you, appreciate it!
@dragallabzpresents
@dragallabzpresents 9 ай бұрын
Being new to Unreal, your tutorials are great. I saw the video like this from a year ago when I was working on the player health bar, and after I looked at a few others I found this when working enemies. I had to make some changes since I use a lot of C++, but without this video I would still be stuck. I also appreciate the demonstration on why things aren't a good practice... like binding. Keep up the food work.
@LeafBranchGames
@LeafBranchGames 9 ай бұрын
Thank you, appreciate it!
@EdvardSvensson
@EdvardSvensson 10 ай бұрын
Awesome! Quick question what's that sound in the background? it's like there's a low sound of someone speaking
@Drakuba
@Drakuba 10 ай бұрын
are those sounds in a room with us right now?
@EdvardSvensson
@EdvardSvensson 10 ай бұрын
​@@Drakuba I hope not or my house would be haunted. At 2:49 I guess you can hear it more clearly, but it's audible throughout the video
@LeafBranchGames
@LeafBranchGames 10 ай бұрын
I am unsure. It could have been picking up audio from a nearby device.
@Rusty0621
@Rusty0621 10 ай бұрын
@@Drakuba No, they are in the video.
@shannenmr
@shannenmr 10 ай бұрын
The double audio / audio in the background does make this video hard to listen to for sure
@ryanjdev87
@ryanjdev87 10 ай бұрын
GOAT!
@LeafBranchGames
@LeafBranchGames 10 ай бұрын
:)
@solidak
@solidak 8 ай бұрын
Your are amazing bro thank you for this tips♥♥
@LeafBranchGames
@LeafBranchGames 8 ай бұрын
Thank you. :)
@Alloart3D
@Alloart3D 10 ай бұрын
perfect ! thank you !
@LeafBranchGames
@LeafBranchGames 10 ай бұрын
You are very welcome!
@JakeA6956
@JakeA6956 13 күн бұрын
This only works for NPCs if the NPC is a child of the player. If you don't have it that way (which you shouldn't unless you have a specific reason) you'll have to create a separate IsOwner for the NPCs, event dispatcher, health, etc. How you "SHOULD" do this is to create a blank character as the "BaseCharacter" that is the basis for which all other characters are derived, reparent your player and NPCs to the base, add the dispatcher to the base instead of the player, and set the interface input to the base instead of player. That way, any alterations you make to the PC have no chance of screwing up something on your NPCs.
@SwirlFrog
@SwirlFrog 2 ай бұрын
go to pixil art, make a circle, fill with some red colors, blur, download. Do the same with a grey one. Use as health globe. Do same for stamina or mana if wanted. Tysm for tutorial
@LeafBranchGames
@LeafBranchGames 2 ай бұрын
My pleasure!
@robinsonanimation
@robinsonanimation 3 ай бұрын
Hey this tutorial works great except if I change computers one computer, the healthbar goes away gradually, in the other the health bar delays and it goes away all at once, is there a way to have this update the same on both machines ? (sort of like deltatime in unity)
@LeafBranchGames
@LeafBranchGames 3 ай бұрын
Delta time is a time elapsed between ticks in Unreal. I did not make use of tick in the tutorial so it is not really applicable. This works for me on multiple computers. So it is probably something unrelated to the tutorial.
@WrathInteractive
@WrathInteractive 5 ай бұрын
The UI owner thing simply doesn't work now even if you take the cast to out as it notes, 5.4.
@LeafBranchGames
@LeafBranchGames 5 ай бұрын
Opened the project in 5.4 Works fine.
@WrathInteractive
@WrathInteractive 5 ай бұрын
@@LeafBranchGames Odd, did it like you and the health didn't work and just swapped to the AI instead, so I was taking damage but the health bar was going down on the AI, obviously missed something, thanks for the video.
@stoneddevstudios
@stoneddevstudios 2 ай бұрын
Getting weird math, I go from 200 health to -175 after causing 25 damage then goes back to 200 and again to -175. UI goes from full to none..Any clue what’s happening?
@LeafBranchGames
@LeafBranchGames 2 ай бұрын
Any number of logical errors in your math could be causing this issue. You are best off to debug your issue to find the root cause. Here is a tutorial on the basics if you are unfamiliar. kzbin.info/www/bejne/sH-aiYKJod10gKM
@kellowattentertainment
@kellowattentertainment 7 ай бұрын
Absolutely amazing. It works perfectly, even if the AI Character child class has different health widgets. I checked. I created an AI Character Base Class and made children, Boss Base Class, regular enemies base class, NPC Base and Companions base. They inherit from the Base AI. You are hands down the greatest. I have a question though
@SwirlFrog
@SwirlFrog 2 ай бұрын
what question?
@gokuvinod2850
@gokuvinod2850 10 ай бұрын
In the last part where u edited a duplicated material and I did the same, and it's working as well, but somehow it feels like low resolution UI and I don't know much about materials can u confirm it's from my side or this technique has this issue in general. Thanks
@LeafBranchGames
@LeafBranchGames 9 ай бұрын
There are many different settings and parameters that can come into play on affected how they UI will look in 3D. So it is not from your side as such. But depending on your use and what you are displaying, you have to set it up for optimal display.
@nairolfri
@nairolfri 10 ай бұрын
Nice video, sadly there is an extra audio in the background that makes it less audible.
@LeafBranchGames
@LeafBranchGames 9 ай бұрын
Thanks, and yes I know. Other comments have mentioned it.
@mahkhardy8588
@mahkhardy8588 10 ай бұрын
Would be great to see this same example setup in multiplayer with best practice.
@LeafBranchGames
@LeafBranchGames 10 ай бұрын
It may come in time. Stay tuned.
@vrhypeguy2119
@vrhypeguy2119 6 ай бұрын
at 21:44 I do what you do ad it stops updating. I did the additional add to hud near viewport but that is not what is stopping it, any thoughts.
@LeafBranchGames
@LeafBranchGames 6 ай бұрын
Make sure to follow the tutorial closely and follow all the steps and you should get the same result.
@vrhypeguy2119
@vrhypeguy2119 6 ай бұрын
@@LeafBranchGames I am gonna restart and see if I can get it right this time lol thanks
@vrhypeguy2119
@vrhypeguy2119 6 ай бұрын
@@LeafBranchGames i did the same again again and it stopped working at the same point. I am in 4.27.
@LeafBranchGames
@LeafBranchGames 6 ай бұрын
@@vrhypeguy2119 Although this is done in UE5, there really isn't any difference for this between those versions. So most likely you are doing the same mistake over and over again. Make sure you are making all the variables of the correct type.
@aaronwoods-lee7700
@aaronwoods-lee7700 9 ай бұрын
So I followed this tutorial but for some reason the widget components on my AI characters do not want to update properly. I have a working widget that does update health if I add to viewport for the main character, but if I do as you demonstrated here with the "get widget user object" attached to the interface the values do not update like it does for the main character that is directly adding to viewport. Also note, I do not want to add to viewport for the main character and instead just want there to be an extra bar above the head of the character displaying health. The only reason I added to viewport was to test function. I hope I gave enough information to troubleshoot. Thanks in advance for the help.
@LeafBranchGames
@LeafBranchGames 9 ай бұрын
Like I explain in the video, they are working the same, just being displayed differently. So it doesn't matter how you want to display it, it should work regardless. Make sure you are following the steps exactly in the tutorial, then when you have it working, you can alter the functionality to how you want it to work.
@MIIFO3
@MIIFO3 9 ай бұрын
Yo, I'm new to all of this i barely know some things about landscapes and other stuff Iam thinking about making an rpg game with a special and really good vfx like when the character wave its sword or some other effects depends on the character My problem (obviously have a lot ) currently is with blueprints and vfx i don't even know how to make a loot chest that spawn random loot in blueprints so any freaking tutorial you can suggest me ? (Something like teaching a child how to walk? )
@LeafBranchGames
@LeafBranchGames 9 ай бұрын
This is a good video to learn a lot of basics in UE5: kzbin.info/www/bejne/pYOzqa13rr14oNU After that, this is the best RPG series on the internet: kzbin.info/aero/PLNBX4kIrA68lz8GSxTQKX_0B23tHP6Bl9 But it is a bit advanced, so if you have trouble following along, you may want to watch videos from the beginner playlist: kzbin.info/aero/PLNBX4kIrA68nyGfIKgyizftebllhKc4ZX
@Oxnin2
@Oxnin2 9 ай бұрын
HI! Nice tutorial (thank you very much!) ------------------------------------------------- EDIT: I noticed the Align Mesh Tutorial, I'm on that rn
@LeafBranchGames
@LeafBranchGames 9 ай бұрын
Thank you!
@SwirlFrog
@SwirlFrog 2 ай бұрын
11:50 lol
@LeafBranchGames
@LeafBranchGames 2 ай бұрын
:)
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
How to Make a 3D Health Bar for your Enemy in Unreal Engine 5
6:43
UE5 Understanding hard and soft references - Be a better game dev
19:58
The Right Way to Spawn Objects in Unreal Engine | UE5
18:03
Ali Elzoheiry
Рет қаралды 44 М.
UE5 Understanding UI Bindings - Be a better game dev
8:37
LeafBranchGames
Рет қаралды 13 М.
How To Create A Basic AI Enemy That Follows You - Unreal Engine 5 Tutorial
14:33
Pitchfork Academy (MizzoFrizzo & Co.)
Рет қаралды 10 М.
How To Make A Health Bar In Unreal Engine 5
15:19
Matt Aspland
Рет қаралды 88 М.
I Struggled With Blueprint Interfaces for Years!! (Unreal Engine 5)
16:48
Glass Hand Studios
Рет қаралды 200 М.
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН