How To Create Enemy Health Bars in Unreal Engine 5

  Рет қаралды 23,910

Virtus Learning Hub

Virtus Learning Hub

Күн бұрын

In this video we'll be taking our AI to the next level, adding in a health bar that floats above the enemies head. We'll be creating a dummy AI, user interface widget and all of the functionality to update the health bar to the health value in the player character.
0:00 - Intro
0:47 - Creating the test dummy
2:36 - Creating the widget blueprint
5:20 - Linking the health bar to a variable
6:30 - Rendering the healthbar in 3D space
9:24 - Update health function
13:14 - Simple damage function
16:40 - Outro
► Learn to build a first person shooter game from scratch: virtushub.com/p/fps
► Want to take your game development skills to the next level? Checkout my website where I offer exclusive perks to help you on your journey to becoming a game developer. virtushub.com/p/virtus-gold
♥ Join the Virtus Discord: / discord
Virtus Creative Hub // Media
● Facebook Page - / virtushub
● Twitter Page - / virtushub
● Website - www.virtushub.com

Пікірлер: 61
@guillermofleitaspulido
@guillermofleitaspulido Жыл бұрын
Hi developers! If you followed this tutorial and your health bar is not changing the problem is here 6:08 you need to add a percent node between the health variable and the return node like in this video kzbin.info/www/bejne/eKG3fIZrYp5-pKc&ab_channel=MattAspland - (3:35) its because the health bar dont go from 100 to 0, it goes from 1 to 0 so you need a float value. This is not a critique i'm just trying to help others. Bye and good luck !
@lapischu12
@lapischu12 Жыл бұрын
Un-sung hero legit
@kiritouzumaki6669
@kiritouzumaki6669 Жыл бұрын
Thank you for the amazing advice, I had already rewatched the video 4 time trying to see where I went wrong. Thank you.
@guillermofleitaspulido
@guillermofleitaspulido Жыл бұрын
@@kiritouzumaki6669 it's a pleasure to help ! :D
@guillermofleitaspulido
@guillermofleitaspulido Жыл бұрын
@@prestonroman You are welcome :D !!
@julia22202
@julia22202 Жыл бұрын
Dude thank you so much! I had been struggling for hours trying to figure out where I went wrong, I should have just looked at the comment section a lot sooner, haha!
@Lyambh
@Lyambh Жыл бұрын
This is so clear. Thank you for the video, love it.
@VirtusEdu
@VirtusEdu Жыл бұрын
You're welcome bro
@zeropalooba8646
@zeropalooba8646 Жыл бұрын
Very good video. Good explaining. Thank you
@CodySmith-ci8hn
@CodySmith-ci8hn Жыл бұрын
Question, how would I be able to implement this onto the top of the FPS player's HUD instead of above the enemies head? For instance, a player shoots another player in multiplayer indicating that users ID name, health and any armor they may have on? Thanks.
@Aditya-us1qn
@Aditya-us1qn Жыл бұрын
Thank you!
@nothingspeaks
@nothingspeaks 6 ай бұрын
for anchoring things to where ever if you hold CTRL + Shift when you press the anchor option itll auto move the thing to that exact location
@Ash-qp3tr
@Ash-qp3tr 3 ай бұрын
How can I toggle the visability of Health Bar on Canvas? Because I have two on my UI, above character and one I've made on canvas
@kevinsmith3348
@kevinsmith3348 4 ай бұрын
Nice clear tutorial. Except one change is suggested to note... to make this work Multiplayer. Instead of creating the Function to update your health, set your Pawn's Health variable to RepNotify. Then put all the same script in the RepNotify function created automatically. Then the enemy health bar will be replicated to other players. Thanks for everything here!
@K0UK0U
@K0UK0U Жыл бұрын
Thank you for the video
@VirtusEdu
@VirtusEdu Жыл бұрын
No problem :)
@helperpat
@helperpat 3 ай бұрын
Regarding anchors: You can choose an anchor and automatically move all selected items by holding ctrl+shift while clicking the anchor you want, saving you some eyeballing.
@zakariatouil3123
@zakariatouil3123 Жыл бұрын
Yo man. Idk why but my healthbar is blurry af. how fix men
@maiworld_
@maiworld_ Жыл бұрын
would this replicate on mulitplayer?
@Youshisu
@Youshisu 10 ай бұрын
Does this widget updated every tick ?
@Yggdrasil777
@Yggdrasil777 Жыл бұрын
Interesting that you have a BIND on the progress bar. Did you know that if you put a Print String on that binding function, you will be spammed with whatever is in the Print String? Every Tick. It updates that health bar every tick. You should use an Event Dispatcher in the UpdateHealth function so that it tells the widget to update the amount.
@LOL1423derp92
@LOL1423derp92 Жыл бұрын
either that or make it event based, where the damage event calls an event to update the health bar
@VirtusEdu
@VirtusEdu Жыл бұрын
We're actually planning on making a second version of this which is more advanced functionality which is more streamlined. That being converting this existing system to be event based and hide when the player is a certain distance away.
@Drakuba
@Drakuba Жыл бұрын
@@VirtusEdu im interested in that one
@AMobOGobos
@AMobOGobos Жыл бұрын
@@VirtusEdu It's been about 4 months. Do you have a timeline for when you are going to create the more advanced implementation?
@DavidGWilliams1981
@DavidGWilliams1981 Жыл бұрын
Who else got bamboozled by the cool looking health bar in thumbnail?
@lordwolf2799
@lordwolf2799 Жыл бұрын
Me bro
@_Debu
@_Debu 8 ай бұрын
is there any way we can show the health bar numbers while we damage the enemy?
@nothingspeaks
@nothingspeaks 6 ай бұрын
if i understand what you mean you can add a text to the widget saying the total number of health they have but in the graph the same way you do the progress basically, just add the text component and set the text to be the health...i think?
@edwardkeefner3540
@edwardkeefner3540 Жыл бұрын
The health bar is never occluded if you use screen space.
@MrLunox
@MrLunox Жыл бұрын
The small things i REALLY like about UE, i dont even have the bind dropdown next to the percentage? wtf
@MartKart8
@MartKart8 Жыл бұрын
Do you know how to make a character stop for a moment when picking up an item, then the character plays an animation, then gets them to move again. I almost got it working.
@RedRidersTerraTrips
@RedRidersTerraTrips Жыл бұрын
on press 'action' set movement speed 0. play animation ?
@EyeNeo
@EyeNeo Жыл бұрын
When picking up the item set the player's max walk speed to 0 or something very low according to your need. Then play the animation and on animation end reset the player's max walk speed
@MartKart8
@MartKart8 Жыл бұрын
@@EyeNeo It works, expect not quite the way expected. I was trying to go with a sort of Super Mario vibe, like how he gets a star or moon, with Mario's stood in place does an animation and moves again. I do like how I'm able to move now and my character isn't human.
@augustforever7198
@augustforever7198 Жыл бұрын
@@MartKart8 You should be able to just use a root motion montage, no need for any extra coding. Movement will be disabled while montage is playing and return when it is finished.
@MartKart8
@MartKart8 Жыл бұрын
@@augustforever7198 Thank you so much, this works exactly how I needed it to. Just went and made the animation slightly longer as it ended too quickly.
@GameRavens
@GameRavens Жыл бұрын
Doesn't work, the variable doesn't display the health for the bar in the widget. edit: The reason it wasn't display is because you need to put 7.5 as opposed to 75 in the video. Fixed the display issue for me.
@TeacherAlthea
@TeacherAlthea Жыл бұрын
Hi, Im very new in here, and I really like the way you explain all these features in Ureal. For this video, I couldn't make the health bar running with the variable. I used "Print String - Variable" to check on the variable alternated, when the ThirdPersonPlayer touch the DummyTest, the variable of "Health" did decrease and also in the function which bond to the progress bar kept showing the changed variable which means function works fine. Also, when i change the value in the variable "Health", the health bar didn't change at all, it keeps on full till the value is 0, then the health bar became empty. I have went through this video and remade the project couple times, still got same issue. Is there anyone can help me? >_
@TeacherAlthea
@TeacherAlthea Жыл бұрын
Should I do any code inside the Event Graph of the WB_HealthBar widget?
@VirtusEdu
@VirtusEdu Жыл бұрын
Hey Yoyo, if you need help with this make sure to join our discord, there are channels for troubleshooting and I can walk you through a lot of your code on there
@TeacherAlthea
@TeacherAlthea Жыл бұрын
@@VirtusEdu Thank You very much!! I will try to join later! really appreciate it!
@kagi852
@kagi852 Жыл бұрын
keep the good work
@VirtusEdu
@VirtusEdu Жыл бұрын
Thank you, I'm glad that you enjoyed it!
@VirtusEdu
@VirtusEdu Жыл бұрын
Are you using health bars like this in your games? I want to know!
@kagi852
@kagi852 Жыл бұрын
yaah but i used to your health bar from old video of your's
@narasimhaprasad9036
@narasimhaprasad9036 Жыл бұрын
Yes
@lezardseventhbible564
@lezardseventhbible564 Жыл бұрын
PLZ do a tutorial about the Health bar in the world space(and always face to the camera) rather than screen space because HP bar in screen space will display even it was blocked by other object and it's very weird in 3D Action game.
@padmspb1
@padmspb1 Жыл бұрын
There are tons of such healthbar instructions in KZbin and everyone do this ugly looking healthbar, which has same size at any distance to character...
@EyeNeo
@EyeNeo Жыл бұрын
The quality of the video is 360p. Please re-upload with 4K or 1080p
@2009142
@2009142 Жыл бұрын
IIRC, KZbin will upload the lowest res first when released and then do the others after. So the higher res are technically already uploaded you may just have to wait
@VirtusEdu
@VirtusEdu Жыл бұрын
The video is in 4K resolution, enjoy!
How To Make Health Bars And Health Pick Ups In Unreal Engine 5
9:31
Unreal ART With Alireza
Рет қаралды 12 М.
How to Make the SUPERHOT Slow Motion Effect in Unreal Engine 5
9:42
Virtus Learning Hub
Рет қаралды 6 М.
格斗裁判暴力执法!#fighting #shorts
00:15
武林之巅
Рет қаралды 13 МЛН
Uma Ki Super Power To Dekho 😂
00:15
Uma Bai
Рет қаралды 36 МЛН
SHE WANTED CHIPS, BUT SHE GOT CARROTS 🤣🥕
00:19
OKUNJATA
Рет қаралды 4 МЛН
Unreal Engine 5 Health and Damage System Tutorial [2023]
27:12
Pixel Helmet
Рет қаралды 37 М.
How To Make A Health Bar In Unreal Engine 5
15:19
Matt Aspland
Рет қаралды 70 М.
Enemy Damage System in 7 Minutes! | Quick Tips | Unreal Engine
7:34
Animated Health/Stamina Bars | Unreal Engine Tutorial
6:48
KomodoBit Games
Рет қаралды 2,5 М.
How To Build an Enemy Health and Damage System in Unreal Engine
17:25
Just Another Dang How To Channel
Рет қаралды 10 М.
How To Build MENUS AND UI In UE5 | Unreal Engine 5 Beginner Tutorial
35:40
Virtus Learning Hub
Рет қаралды 115 М.
How to Make a 3D Health Bar for your Enemy in Unreal Engine 5
6:43
I Struggled With Blueprint Interfaces for Years!! (Unreal Engine 5)
16:48
Glass Hand Studios
Рет қаралды 165 М.