Тёмный

Health, Damage, and Respawn Tutorial for Unreal Engine 4 (Blueprints) 

Pending Kill
Подписаться 3,2 тыс.
Просмотров 78 тыс.
50% 1

Source code: github.com/xuelongmu/HealthDa...
More info on Apply Point Damage: • WTF Is? Apply and Rece...
More info on Apply Radial Damage: • WTF Is? Apply and Rece...
In this video we're going to cover a basic health, damage, and respawn system written in Blueprints that you can use in your games, whether that’s a shooter, RPG, platformer, or almost any other genre.
TABLE OF CONTENTS
00:00 Introduction
00:34 Health System
04:49 Respawn System
13:34 Reusing Code with Inheritance
15:53 The UE4 Built-In Damage Interface
Help us make more videos by supporting our Patreon: / pendingkill
Come say hi!
Twitch: / pending_kill
Facebook: / pendingkill
Twitter: / pending_kill
Instagram: / pending_kill
TikTok: / pendingkill

Опубликовано:

 

5 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 172   
@PendingKill
@PendingKill 3 года назад
A big thank you to viewers who pointed out ways to improve parts of this system! Here are their suggestions: 1. 07:05 To easily center the widget, place the anchor in the middle, then go to the alignment section and for both x and y put .5. Also tick the checkbox “size to content” that will make the box be the size of whatever is inside it. 2. This health system could potentially be improved by refactoring it as an actor component. Will plan on covering this in a future video :)
@MaximilianMitchell
@MaximilianMitchell 3 года назад
Glad to see my comment on Reddit for aligning the widget to the center is here. Hope it helps people! Great video for beginners!
@PendingKill
@PendingKill 3 года назад
@@MaximilianMitchell Thanks again for the tip, always appreciated!
@PenSyrup1
@PenSyrup1 3 года назад
Can anyone help me i need to restart the level but i dont want to reparent my level because it is a fps template so when i reparent it screws everything up
@HarjyotR
@HarjyotR 2 года назад
@@PendingKill hi great tutorial 👍 but is there a way to make it multiplayer because the client just freezes after you respawn and the server player can move but is like in a diffrent world because you can't see client and client only see dead body and instead of restarting game to respwn character is there a way to repawn character without resetting
@dranoel9881
@dranoel9881 2 года назад
You came straight to the point. You spoke clearly and explained a lot. And made the tutorial as quick as possible, while not rushing it. 10/10, can´t do it any better at this point :D
@coffee_enjoyer_
@coffee_enjoyer_ 3 года назад
This has not even 1k views? It was really helpful to me! Really underrated video! Thanks
@PendingKill
@PendingKill 3 года назад
Thank you! Glad it was useful!
@hellotoyou14
@hellotoyou14 2 года назад
but any other some shit about nothing for stupidity have millions .Nothing useful, stupidity and nothing. This is reality :) But this video and other learning goes to shadow.
@TheOnlyLucatoni
@TheOnlyLucatoni 3 года назад
Amazing tutorial keeping it really simple and explaining every step for us beginners, extremely underrated.
@SketchTheArtist
@SketchTheArtist 2 года назад
Great tutorial! Simple and well put together. One of the best I've seen. Thanks!
@Yannnus
@Yannnus 2 года назад
Oh my... Thank you so much for this!! In just 4 minutes I learned easily how to take damage, that's awesome. Keep up the great work, you have a new subscriber (and fan)!!
@emirisik
@emirisik 2 года назад
If you are trying to implement this system to a current project you have and you keep getting Accessed none trying to read property errors, be sure you check the variable with "? Is Valid" before casting or doing something with it. Cheers for the amazing tutorial, top quality!
@DaGamerDad
@DaGamerDad 3 года назад
4 minutes in this video has saved me from 3 days of headache! Thank you! 10 minutes in this video is already the mvp of game mode mechanics. Thank you again!
@Skyflairl2p
@Skyflairl2p 3 года назад
Man, If it wasnt for you and a couple other HIGHLY underrated youtube channels i would struggle so damn hard with keep myself motivated everytime im stuck on something. This is amazing, yet again its straight to the point and incredibly well explained! I can't thank you enough for these tutorials!
@PendingKill
@PendingKill 3 года назад
Thank you so much, that means a lot! We'll definitely keep going with the tutorials :)
@Skyflairl2p
@Skyflairl2p 3 года назад
@@PendingKill You plan on following this one up with some info on combat vs some basic ai? That would be great!
@PendingKill
@PendingKill 3 года назад
@@Skyflairl2p Combat-wise, we're planning on a Gameplay Ability System tutorial, which lets you use replicated abilities (spells, melee attacks etc) for multiplayer games. but if you're looking for a basic AI tutorial with shooting mechanics, Asher Einhorn has an excellent series: ru-vid.comvideos
@Skyflairl2p
@Skyflairl2p 3 года назад
@@PendingKill Cant wait!
@deathdemon6960
@deathdemon6960 Год назад
My good sir, I thank you for this tutorial. I was doing this for a game that I'm making in UE5, and this still worked perfectly.
@yasuologitech1084
@yasuologitech1084 2 года назад
Thank you so much for making this tutorial, super easy to follow and super useful
@michaelfloyd2477
@michaelfloyd2477 3 года назад
Yo this was a dope tutorial. I like your method of setting up damage wayy better that what I was doing.
@PendingKill
@PendingKill 3 года назад
Thank you! More coming soon.
@hiimathao
@hiimathao 2 года назад
this is the best damage updating i seen sooooo simple.
@musikalniyfanboichik
@musikalniyfanboichik 3 года назад
very professional and to the point! subbed
@HaikuTutorials
@HaikuTutorials Год назад
Really crazy tutorial. Thank you soo much for this. Here is everything I need :)
@jeancarrascoplane5579
@jeancarrascoplane5579 3 года назад
Straight to the point, amazing!
@sunso1991
@sunso1991 2 года назад
thank you for the tuto! very clear and useful
@glormond
@glormond 3 года назад
That''s amazing tutorial! Thank you!
@PendingKill
@PendingKill 3 года назад
Appreciate it!
@joakal14
@joakal14 2 года назад
Thank you so much! This tutorial saved me so much time!
@sideroshemimorphite8760
@sideroshemimorphite8760 Год назад
GoodWork!! Thats exactly What I wanted! Thank you. Nice explanation in details, which helps a lot.
@JacobWort-Field
@JacobWort-Field 2 года назад
Thanks for this video this fixed all my problems with my death and health system :)
@likadsplit
@likadsplit 2 года назад
This tutorial fully worked thank you !!
@bnmangaman
@bnmangaman 3 года назад
very well made tutorial thanks!
@gamedevpaddy3944
@gamedevpaddy3944 3 года назад
Dude you are awesome thanks for the help, really appreciate it keep at it!
@PendingKill
@PendingKill 3 года назад
Thanks appreciate it :D
@rifz42
@rifz42 3 года назад
thanks for this! and adding the code is great! you may want to say this is for Blueprint in the title..
@PendingKill
@PendingKill 3 года назад
Will add that!
@CediEntertainment
@CediEntertainment 2 года назад
Great stuff, even as a complete novice this helps me a lot
@lightyagami6307
@lightyagami6307 2 года назад
Thanks a lot . Nicely explained
@DigeL-el6uo
@DigeL-el6uo 23 дня назад
Thank you, great tutorial, easy to follow. Also works with UE 5.4.2...
@nex8939
@nex8939 2 года назад
Super helpful video, thank you
@mintytavor8332
@mintytavor8332 2 года назад
Thank you so much you deserve more subs
@utkarshnaik1014
@utkarshnaik1014 3 года назад
bro u make my game so cool thank you
@DigeL-el6uo
@DigeL-el6uo 8 дней назад
Quick and dirty. I like your style, great tutorial.
@booo-live7624
@booo-live7624 2 года назад
really cool!
@justinoner2017
@justinoner2017 3 года назад
This all works great, I tried to add the same damage and collision you did with the box to a character that moves, when the player bumps into them no damage is being done, but when the player bumps into the box it does damage like usual.
@FlyPimpDude
@FlyPimpDude 2 года назад
Great tutorial. Learned a hell of a lot. I like that I got the rug pulled from under my feet when we started stripping code out to redo in base character. At the time I was like Noooooooooooo! what are ya doing? but this way dropped a few Ah-ha moments in my hazy understanding of interfaces. So for that I say many thanks Good Sir! :D Btw this still works in UE5
@tobi8445
@tobi8445 2 года назад
If only he also covered a checkpoint system, it would be nice so as not to let the player start all the way at the start of the level.
@jonathanodonnell3831
@jonathanodonnell3831 3 года назад
i have to rework my checkpoints but this was very helpful to finally get my character to take damage and respawn when health goes to 0 and respawn thanks
@deid476
@deid476 3 года назад
I love it ! Thanks
@CodyReader
@CodyReader 2 года назад
Thanks for the help fam.
@joshuapinson5632
@joshuapinson5632 2 года назад
This helped so much
@kimped5
@kimped5 Год назад
I was looking for this one! Thanks. Do you have with healing also?
@joshfx1801
@joshfx1801 2 года назад
fantastic video. fr
@GokdenizCetin
@GokdenizCetin Год назад
Thanks!
@sebastianvoinea1189
@sebastianvoinea1189 3 года назад
Very Good tutorial but If you want to make a checkpoint this system wont work because at the end it just restart everything. If you wanna make this system to work with checkpoints I recommend to make a transform variable and then set it to the spawn location. And after that instead of restarting the game just spawn the character at the position that you set in the variable. (My explanations are kind of bad I know)
@MrPolugnis
@MrPolugnis 2 года назад
Can you explain exactly what to do to make it work with checkpoints? Im confused on that!
@emilebrodeur2091
@emilebrodeur2091 3 года назад
Good work
@PendingKill
@PendingKill 3 года назад
Thanks so much! means a lot coming from Game Dev Pantry :)
@GrifChan
@GrifChan Год назад
Tanks it helped a lot ^-^
@letena1k
@letena1k 3 года назад
Thank you!
@ogurexin4327
@ogurexin4327 2 года назад
tNice tutorials, good luck- you'll go far
@Matooki
@Matooki 2 года назад
Lets say I want to have obstacles in a game that kill the player, Do I have to make knew damage actors for each mesh or is there a way I can apply this one to different meshes
@gamingoverpowered4127
@gamingoverpowered4127 2 года назад
Thank you it helped so much. at the moment i am making a survival game called Lumber Life
@_jacquey
@_jacquey 3 года назад
This was great, I did it successfully. Only thing, the health could use some better visual, a health bar or something
@j_dggaming6414
@j_dggaming6414 3 года назад
hey what if the gamestate is called character what can I do cause if I change it the code starts erroring
@Lita1
@Lita1 Год назад
Very helpful video and I liked it too yes!!!!👍😅
@Alxndr32
@Alxndr32 3 года назад
Does this work with the First person game aswell? When I tried to change the "GameStateBase" to "GameState", it destroys my game and freezes everything. By the way, good video!
@aelren
@aelren 22 дня назад
helpful, thank's
@kreesgaming
@kreesgaming 2 года назад
Thx bro
@shakaama
@shakaama 3 года назад
ok i completed this with only 2 mistakes. guess i'm getting better. full complete.
@Dreamer_3333
@Dreamer_3333 Месяц назад
ayo good tutorial so simple and easy but how do i create a health bar to this damage system? i was trying to use other guys tutorials but ir didnt work here
@IoSkyBoyoI
@IoSkyBoyoI 2 года назад
Any chance youd cover the Event Onreset node?
@whoissyx
@whoissyx 2 года назад
this tutorial is awesome but I am wondering how you would go about making health as a standalone parameter to individual characters that is then called into the damage bp to be used so you can have unique health amounts for each character in a game(if this is at all possible)
@dylanroemmele906
@dylanroemmele906 2 года назад
You probably already got it but incase someone else doesn't, each instance of the character blueprint health variable is unique.
@PenSyrup1
@PenSyrup1 3 года назад
Hi is there any other way i can restart level without changing level parent because when i reparent my level all ther stuff malfunctioned and i had to go back
@lollerkiller900
@lollerkiller900 3 года назад
i got a Big Problem. if i am Opening another Level ingame, it says "you Died" but you can play the Character. now if you Die, it restarts the level like normally and the Text is gone. so, if i remove the Parent in the Widget BP, it doesnt show anymore in the normal Death-Screen.
@bendergriffey8560
@bendergriffey8560 2 года назад
hey man this is amazing i really appreciate you taking the time for us noobs but i seem to be missing something. when i tun into my damage actor it immediately kills me no matter how low i set it’s damage. i think saying my default health is 0.0 but i keep making that higher and to no avail nothing is changing. any ideas to what it could be?
@coltonkearschner9593
@coltonkearschner9593 Год назад
did you ever figure this out? I am having the same issue.
@SegoItChUA
@SegoItChUA 2 года назад
So sense of using custom damage system when we have Unreal one?
@CommanderColson
@CommanderColson 3 года назад
Is there a way to have health slowly deteriorate over time, only to be replenished when the player picks up a consumable ('food', 'power up', ect)? Think the Health+hunger+hydration system a lot of survival games have, but simplified into one single life bar
@PendingKill
@PendingKill 3 года назад
Sure, you can have a timer set up on a specific interval that will decrease the player's health every time it gets called.
@SoundsLikeGlitter
@SoundsLikeGlitter 2 года назад
Does anyone know how to implement a health bar widget to show the entire time? Tried following another video but due to use changing a lot of class and project settings, that video wasn't compatible
@dorondavid4698
@dorondavid4698 2 года назад
What do you mean the entire time? Make a HUD widget, add the health bar, and then add it to viewport
@soschu8469
@soschu8469 2 года назад
hi there, following your tutorial, after setting up the instant kill box and trying out the result, the level doesn't restarts and i get the following error message: "TravelFailure: ServerTravelFailure, Reason for Failure: 'Failed to load package '/Game/UEDPIE_0_us_topdown_shooter_map_level_1''. Shutting down PIE." do you know how to fix this? thx
@JeekyWeeky
@JeekyWeeky 3 года назад
for some reason after i die in my top down game, my camera starts pointing directly at the sky instead of at the character that just died? help?
@kingcowgill
@kingcowgill 2 года назад
Hi im stuck at 13:10 because when I fall off world, the Z kills me but nothing happens am I doing something wrong? Blueprint Runtime Error: "Accessed None trying to read property PlayerCameraManager". Node: Start Camera Fade Graph: EventGraph Function: Execute Ubergraph BP Player Controller Blueprint: BP_PlayerController.
@wividscorpion7681
@wividscorpion7681 Год назад
how can i change the game mode to regular if the game mode asset is completely blank
@deceptivetorch7557
@deceptivetorch7557 3 года назад
How would I go about removing pre-existing UI (such as an onscreen reticle) whenever the “You Died” screen appears?
@dragishawk9564
@dragishawk9564 3 года назад
To remove widgets from the screen when your character dies and the Death Screen (as I call such screens) appears, you'll need to get the widget you want to remove and then use Remove From Parent in a way similar to what this tutorial does for the Death Screen after two or so seconds and the game restarts. I had to cobble together something like this for getting rid of the health bar that I was implementing with this system, since it was still onscreen when the Death Screen came up for me.
@Scionate
@Scionate 3 года назад
You should really look at the overview of the engine framework in the docs and test that respawn in standalone.
@bartekwoj2773
@bartekwoj2773 2 года назад
Hi i have problem it seams like i cant find the "restart game " it only gives me "restart player" and it compleatly stop my character from moving now :C Help!!
@AscaronFrid
@AscaronFrid 3 года назад
good ! like !
@foxywoxy0w068
@foxywoxy0w068 3 года назад
So I followed your video but it doesn't seem to be working at all, I'm doing a Side scroller so I don't know if that affects it in anyway but when my character touches the cube, they don't die at all. Which is weird as I'm pretty sure I did everything right, unless this type of death only works for Third Person and not Side Scroller.
@PendingKill
@PendingKill 3 года назад
The death should work for side scroller. Perhaps you can check your collision settings, and step through the blueprint logic with breakpoints to make sure the death event is getting called.
@Primoris
@Primoris 3 года назад
How would you stop the death screen from displaying when you change levels?
@PendingKill
@PendingKill 3 года назад
I believe that as it's set up in the sample project, the death screen only displays when the character's health dips below 0, not when the level changes. But if you're trying to change levels after the screen is already showing for some reason, you could call the "Remove from Parent" function on the widget.
@mythanimation4547
@mythanimation4547 2 года назад
When the player dies, it goes straight to "Game Over" instead of fading to black. Is there a reason why that might be the case?
@SoundsLikeGlitter
@SoundsLikeGlitter 2 года назад
Help. All my nodes are connected and are as his but everything works and executes EXECEPT "cast to BP controller and call on death blueprint"
2 года назад
Do not copy paste the nodes. You need 2 nodes. Get Player Character and Get Player Controller. Get Player Controller > Cast to BP_PlayerController > Call On Death. It should work.
@N4NT4
@N4NT4 3 года назад
I can't find the components tab in my actor, it just isn't there, can anybody please help
@vulcanhd1649
@vulcanhd1649 2 года назад
Hey, i am using UE5, and i dont know if this has anything to do with it, but when i start the playercontroller the first time we make it actually die, my PIE just crashes once the onDeath function has actually been called. bere is the error message i am getting. TravelFailure: ServerTravelFailure, Reason for Failure: 'Failed to load package '/Game/ThirdPerson/Maps/UEDPIE_0_ThirdPersonMap''. Shutting down PIE.
@spx_waterkitty9197
@spx_waterkitty9197 2 года назад
yeah same
@ravenousoreo
@ravenousoreo 3 года назад
hey hey! so just a quick question! I followed your steps and obviously they worked (don't want to get off topic here but for some odd reason when it comes to making some things in ue4 like my games movement mechanics I have no issue but simple things like this are really hard) but what I wanted to ask was when I use your system I can't get a binding for a progress bar to show current player HP to work! it just tells me something like HUD does not inherent from. I'm fairly new to UE4 and game dev overall so if someone could help me fix this that would be greatly appreciated! the current setup I had that was working until I used this was a cast to first person character and then current hp/ max hp
@PendingKill
@PendingKill 3 года назад
Hey - best way to get help is if you can take some screenshots of your code and post in the Unreal Slackers discord server (you can google for it). It's probably something simple to fix.
@ravenousoreo
@ravenousoreo 3 года назад
@@PendingKill wow not only did you respond quickly but even off a video this old. You've got my sub!
@issamaf80
@issamaf80 3 года назад
Nice! i would love to see a tutorial on how to add Start and Stop Transitions animation for both walking and running there is free pack in the marketplace that goes by the name of MCO Mocap Basic or alsV4 that has some animations that you will need for this.
@PendingKill
@PendingKill 3 года назад
Thanks for the suggestion, I'll look into that!
@issamaf80
@issamaf80 3 года назад
@@PendingKill would be great to see since there are 0 tutorials on how to do this.
@rifz42
@rifz42 3 года назад
I would also like to see a tutorial about this! thanks!
@rawbeats369
@rawbeats369 3 года назад
When I click on firstperson game mode there's no event graph
@ImagineThatStudiosYT
@ImagineThatStudiosYT 2 года назад
I have a question, If you set the restart game node, does that mean the entire game will be reset to the very begining?
@CapKep
@CapKep 2 года назад
Yes it is
@seyff367
@seyff367 2 года назад
everything works fine except the restart. Getting this: TravelFailure: "ServerTravelFailure, Reason for Failure: 'Failed to load package '/Game/ThirdPerson/Maps/UEDPIE_0_ThirdPersonMap''. Shutting down PIE." Anyone who can help?
@arisunreal4473
@arisunreal4473 2 года назад
how do i add a health bar?
@N0T_Dem0n
@N0T_Dem0n 3 года назад
How would you make a health bar from this health system?
@dragishawk9564
@dragishawk9564 3 года назад
There are tutorials for implementing health bars elsewhere here, and they aren't too complicated to implement, since they key off the same variable (Health) as the damage system that is outlined here. You'll just need to stick in a Remove From Parent function for the widget in question when it comes time for your character to die, otherwise that health bar will stay on your screen when the "You Died" screen shows up, as it did for me before I cobbled together a solution. You'll also need a way to ensure that the Death Screen comes up for you and you alone instead of having it go off when you kill an enemy, but Pending Kill likely has a tutorial for handling just that.
@MegasVN69420
@MegasVN69420 3 года назад
nice you should have more subcribers
@alissanweb7071
@alissanweb7071 2 года назад
successfully destroyed my project trying to follow this. 10/10. slow... tf... down please.
@hristohristov9864
@hristohristov9864 3 года назад
I have a Problem and I'm not sure why... So my health is going under 0 but my character isn't dying, my camera isn't fading and the text "You Died" isnt popping up... Plz help!!
@PendingKill
@PendingKill 3 года назад
That's a lot to unwrap, at which step did you start noticing failings? Once we identify the step, we can help correct it.
@laszlob3683
@laszlob3683 2 года назад
5:83 there is nothing like unposess actor or pawn in ue 4.26
@laszlob3683
@laszlob3683 2 года назад
5:38 detach from controller pending destroy in ue 4.26
@unsolved1585
@unsolved1585 2 года назад
hey I've done everything to a tee i believe, but I am getting this message.. Anyone know a solution? TravelFailure: ServerTravelFailure, Reason for Failure: 'Failed to load package '/Game/Stuff/UEDPIE_0_NewMap''. Shutting down PIE.
@unsolved1585
@unsolved1585 2 года назад
Happens after I die and go to respawn.
@unsolved1585
@unsolved1585 2 года назад
and yes new map is my original map :P
@lionlion7538
@lionlion7538 3 года назад
this tutorial destroyed my game.. i had a custom character i made and now i can only use the default one from ue4 please help
@mauriciosilva1631
@mauriciosilva1631 3 года назад
how does the damage be random? type every time the character takes damage he can take damage between 10 and 30
@PendingKill
@PendingKill 3 года назад
You can use a Random node: docs.unrealengine.com/en-US/BlueprintAPI/Math/Random/RandomFloatinRange/index.html
@mauriciosilva1631
@mauriciosilva1631 3 года назад
@@PendingKill thank you very much
@RealityGamez
@RealityGamez 3 года назад
Hey so im using everything & when i go to another level and die i want to make it so i spawn at the level, ive tried reset level and restart level & player, thanks!
@PendingKill
@PendingKill 3 года назад
What you would need to do is Open level and name the last level you were in. I highly recommend that you review our basic game tutorial to see where to place and how to access such data so that you can reload accordingly: ru-vid.com/group/PLqE-M9bkjoRgzSQGrBCGuLUAhCgFYzXXd
@RealityGamez
@RealityGamez 3 года назад
@@PendingKill Ok so i have it so when you reach a trigger a menu appears, it gives 2 buttons. those buttons are 2 diffrent levels (the first one being the one your on & the second one being the next level) then i click the 2nd one and it puts me there but when i die in that level it respawns me at the default (last) level. i watched the video you told me to but i dont have the same setup
@RealityGamez
@RealityGamez 3 года назад
@@PendingKill (in button click - open level) that is the bp system for it
@MrGhostYT_
@MrGhostYT_ 3 года назад
saving a timestamp lmao (13:28)
@Farisazfar98
@Farisazfar98 2 года назад
I did until 10:35 but when i test it , the player won't move with the usual controls
@Farisazfar98
@Farisazfar98 2 года назад
I re-change gamestateclass form game state to game state base , and now the player are able to move again
@randomcallum
@randomcallum 2 года назад
on the off chance you hit my dum problem make sure your box cullsion isn't set to block all or it won't be able to overlap and no damage will be done
@armeddreams9141
@armeddreams9141 3 года назад
Can you explain the steps needed to make the health become a visual widget on screen? Like a health bar, and only on player characters and not other things like enemies, since they don't need ui's.
@Iyadll
@Iyadll Год назад
i dont have event take damage
Далее
Conquering fears and slippery slops on two wheels!
00:18
НУБ ИЩЕТ ЖЕНУ В GTA SAMP
22:34
Просмотров 162 тыс.
Can We Save Goku In 5 SECONDS⁉️😰 #dbz #goku
00:15
How To Make A Health Bar In Unreal Engine 5
15:19
Просмотров 74 тыс.
Games Where You're NOT the Main Character
14:52
Просмотров 1,9 млн
Unreal Engine 4 Blueprint Tutorial for BEGINNERS
19:43
Просмотров 184 тыс.