How to Make a Simple Damage Indicator in Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys welcome to new Unreal Engine 5 tutorial and today I'm going to show you on how to make a simple damage indicator it's gonna be a very easy video to follow so let's get started but first check out the link in the description to get out with some Unreal Engine courses on winfox alright so let's get started by actually creating the widget and the text that will pop up with this animation and later on we'll go ahead and implement it in the player's head Etc or the enemy's head or whatever so I'm gonna go ahead and right click user interface and go into widget blueprint it's going to be a user widget there we go uh it's gonna be WB underscore uh well damage indicator I think that's a good name okay of course you can name it whatever you want but anyway so let's go ahead and open this up and we're going to do is simple as getting a text reset uh uh oh my God okay there we go I was blind just drag it in here so now we have a text block and now we can make it a bit bigger so in font in size go ahead and also gonna Center and then we can for example place a placeholder okay so for example 20. now of course it wouldn't appear 20 it will be you know dynamic on whatever damage you got but it's just an example to see how it will kind of look you know what I mean now I'm gonna add a margin on the top like let's see a hundred uh way more like 500 yeah 450. yeah 450 to kind of Center it I'm gonna make a bit bigger you know and then actually use 400. okay so like 400. you can play with the settings but it's kind of to get the idea and then we'll go ahead and place it in the top so this is gonna be the uh well the damage um text or txt and I'm gonna go ahead and set it into be a variable so we can later go ahead and access it from outside and stuff even though we might actually do it from the graph we'll see so we're gonna go ahead and create a simple animation of just like swiping up or just appearing or whatever so there's a lot of things that we can do so go ahead and select it we can go to animations if you don't see this tabs you can just go into windows and then you will see everything so go ahead create new animation it's gonna be just I mean pop up and just name it like that oh we don't we can't have any spaces so just gonna say pop-up I'm gonna go ahead and select it and now we can add a track now I guess it's going to be a text and there we go so the first keyframe will be well totally invisible so what I'm going to do is remember the size which is going to be 175 okay which is a nice number I think so we're gonna start with the zero so let's go ahead and um put a s0 well a one but it's barely visible and now we're going to do is just basically go ahead and oh yeah I forgot we cannot actually keyframe um the size which is really bad so let's go ahead and use um keyframe the opacity okay so I'm gonna make it better we'll kind of uh transition very quickly okay so at the start will be to zero so now we can just add a keyframe over here and that will be added and then after a while uh which will be quick pretty quick you know but anyway we'll see on tune in later now increase it into world one now we can add another keyframe now you will see that there you go we have a nice damage pop-up and I'm gonna make it even a bit quicker kind of there and then I'm gonna do at the end that it will go back into zero and then add another keyframe so now we'll be like pretty quick you see our simple damage indicator that's how it looks pretty cool so now we can do is say compile and save so let's go ahead and create a simple you know enemy there is just going to be standing for this tutorial but I'm just gonna trigger a damage event and we'll just enable the pop-up just to Showcase in the video and now later on you can integrate in your enemies let's go ahead and create new Blueprint Card it's going to be type character underscore or PP underscore um I'm gonna say enemy uh and then because I already have like BP enemy this price you can say BP enemy and damage okay anyway let's go ahead and open this up and the mesh is it's gonna be as simple as just getting a um um yeah you say simple mannequin SK man is simple minus 89 minus 89 there we go and then it's like degrees and then you guys gonna have place your uh many there you go now he has his simple slang animation so let's go ahead and use Dragon into the scene over here it's gonna be play uh facing us and now we can go into the van grab and we can delete everything over here and I'm gonna go ahead and right click and say um um on any damage event well type any damage there you event any damage that's how it's called okay so uh when we reset damage this is what the enemy receives damage it will go through this so call whatever it goes over here so what we're going to do is as simple as just go ahead and for now you say print string it's going to be used for example uh damage taken out I'm not making a combat system or a health system I do have tutorials on that so I will be linking them in the description just in case you will later on want to integrate what I'm doing in here now I'm going to do a very simple thing I'm just gonna go into the third person character blueprint and what I'm going to do is that when I press the left Mouse button so I basically left click I'm going to go ahead and get all actors of class and then I'm gonna use simple as find my MVP enemy damage dude I'm just gonna go and get the copy zero so basically what I'm doing just getting this enemy in the scene the first one that I find of course this is not how you want to do it later on you want to integrate in your combat system as the one that you actually hit with restore the stuff and just again to show you how it will work anyway so what we want to do is basically uh apply damage so let's go ahead and apply damage into this actor and now we can just say for example I don't know uh yeah a ton of damage each time you can change this as you would like to do so but now we can close this and now we can go into the the damage actually we can just test it out so now if I were to press play and I left click you'll see the damage taken print at the left of the screen as you can see so of course now it's working so we need to go ahead and create the pop-up so go ahead and call the thing so I'm gonna go back into the animated uh damage to the blueprint oh my God I'm speaking too fast maybe and now we're going to just go to the beginning gameplay and just go ahead and create the widget okay actually sorry sorry it's gonna be in 3D so we actually don't need to do in blueprints we have to go into the mesh and just add a widget now it's going to be a normal widget and it's going to be for example the and damage in the indicate or which it will go and then we're going to do is set the parent uh sorry the uh here the widget class to be well the one that we created which is the damage indicator now you can put the parent socket to the head so it will automatically be here and it will follow the animations but in my case I just like to do it so now you'll see that uh we actually don't see anything now this might be because it's too small too big Etc well we're going to do is actually go back into the widget and what we're going to do is set the color and opacity to be one um basically by default okay so I didn't break the animation okay just make sure that now there you go we can see down here so uh go ahead and start rotating this into degrees and place it it's pretty big now you'll see that is uh like cut maybe depending on how you size in the blueprint uh which side so in the draw size we can just increase the um the Y into like 2000. awesome whatever you want and now we can just place on the head and make it smaller you can play the settings and there we go and we just appear there there we go so now we can compile and save so now we go into the van graph and then after we print just to make sure we're doing something we'll get the damage indicator widget and now we can do is um cast to um about the the damage indicator now going to do is first is get the widget that we got now we want to cast to the damage and you get WB why do we get okay so now we can go ahead and get this pop it over here and now we want to do is call an inventor that we're going to go ahead and create in the widget so I go here and into the graph and now we're going to delete everything but when I got a custom mine it's going to be apply damage for example so we're going to do is go and get the damaged text and then get it and then we'll say it's set text so now it will set the text with the according damage that we have so in our case we can just drag it as an input and then we can just change this into damage and then in the pop-up we just drag it get it and then say play animation and I will just go ahead and play the animation and with the text um well place over here so now we can go back into the blueprint and now we can just get and say and we'll apply damage and now we need to pass the damage as an input so we can just get the damage that we received from when we called run the player and then just pass it over here so now you will see that if I press play you will see that the you know damage is there this is because I Made It by Devo so we'll go ahead and disable now moment but if I go ahead and press left click you'll see that the animation actually appears and then disappears real quick and then also is with the 10 of damage that I passed on the player over here which is 10. if I were to change this to five it would change now we can change the animation to be a bit cooler and stuff and that sounds of course this is uh well I will leave that into your customization uh but there's other things that we can kind of change and for example we can change the translation so we can like go from being like I don't know minus 10. uh or I've been more or less see how that changes yeah like oh actually positive so like yeah mine uh yeah 500. okay so it's gonna be from 500 so let me keyframe that to then go ahead and go up into zero and then keep playing that and then on here go up into minus 600 yeah minus well minus 500 and then keep them again so now you will see that we have a real cool nice effect now it's very fast so what I'm going to do is that it disappears before it goes back up you know what I mean yeah that's a bit better of course you can play with the timing and stuff to make it better also go ahead and disable that now you'll see that there's a few issues here uh oh actually no okay so now you can see that it's actually working pretty good um so yeah uh the thing that I want to get out is just the default um to be empty in here without anything sorry nothing there we go so it's not visible we're gonna go into the blueprint just go into the event Tech and then what we want to do is basically um get the widget and then set rotation wall rotation plug this in over here and now what we're going to go ahead and say is the new rotation will be a find look at rotation the start point is going to be from here so um where's everybody said yeah yeah we're gonna get the widget again get a location so it's gonna be the world location and the target is going to be the and get camera a player camera manager and then I'm gonna get the location and I'm gonna plug that in so this will it will do is that it will always be facing the camera as you can see if I turn it's always facing the camera so that's cool because you can you know play around with these settings in order to you know make good and customize it like you like for example maybe increase a bit or make it a bit smaller if so into your preferences so for example yeah it will make it smaller Maybe 0.17 you know I can play with these settings to achieve what you want as like I said and then play your sound Etc that's it guys if you need to turn on family helpful I really appreciate if you could like the video and subscribe to my channel I have lots of Unreal Engine 5 tutorials so with all that said bye bye [Music]
Info
Channel: Gorka Games
Views: 8,227
Rating: undefined out of 5
Keywords: games, videojuegos, unreal engine, unreal engine 5, ue5, damage indicator, tutorial, quixel, megascans, unreal engine tutorial, ue5 health indicator, ue5 damage pop up, unreal engine damage indicator widget, unreal engine 5 damage indicator Ui, unreal engine 5 simple damage indicator, unreal engine damage indicator health, unreal engine 5 health damage indicator easy, unreal engine 4 damage indicator, unreal engine 4, ue4, unreal engine 5 damage indicator bp, ue5 simple damage indicator
Id: 6-OQiKK6W1I
Channel Id: undefined
Length: 12min 58sec (778 seconds)
Published: Thu Jan 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.