Unreal Engine 4 - AI Damage Player

Поделиться
HTML-код
  • Опубликовано: 4 фев 2025

Комментарии • 105

  • @nintomdo6472
    @nintomdo6472 3 года назад +1

    i know this video is 4 years old at the time of me writing this, but I feel I need to say a massive thank you for this tutorial. This shit had me stumped for days because it wasn't working right based on the litany of other healthbar tutorials i found, and yet I come across yours and everything worked first try. Fantastic stuff. Thank you!!

  • @curtisjones4428
    @curtisjones4428 8 лет назад +2

    By far you have the most instructive and to the point walkthroughs on RUclips. Thank you for these.

  • @mantronicsenterprises
    @mantronicsenterprises 7 лет назад +5

    Your AI series is very good, thank you for making these tutorials.

  • @PoopaScoopa
    @PoopaScoopa 8 лет назад +1

    Awesome job making these tutorials man, this is definitely the most compact and comprehensive tutorial on Unreal enemy AI behaviour that I have seen on RUclips.
    Throughout the video I was continously surpised at how many times you added a feature, and I went all "yeah that's nice but that won't work if..." and then you fixed the "if"-problem before I finished my sentence in my head xD

  • @310thebank
    @310thebank 7 лет назад +20

    can you make a video maybe after our hp gone we play animation die and it have text pop up to restart or something

    • @nahiansharif4200
      @nahiansharif4200 4 года назад +1

      ruclips.net/video/68KSATgkt6k/видео.html
      here's one video

  • @unallocated7932
    @unallocated7932 7 лет назад

    Thanks for the help i have things set up a little differently so i had to chance a few changes but overall pretty good

  • @kajli3894
    @kajli3894 6 лет назад

    Thanks man, you really helped me and I learned a lot.

  • @phaeton01
    @phaeton01 7 лет назад

    perfect, im gonna plow through these next weekend and ill be all set

    • @phaeton01
      @phaeton01 7 лет назад

      only issue ive found so far is when it attacks me, it empties the health bar in one then fills it again with each attack, cant see where the math went wrong

    • @unallocated7932
      @unallocated7932 7 лет назад

      had the same problem and i know how to fix if you still need help?

    • @unallocated7932
      @unallocated7932 7 лет назад

      make sure The Current player health (whatever u have it named) is plugged into the top of the float - float and the damage is plugged into the bottom
      Heres a picture if you dont get what im saying
      drive.google.com/file/d/0B9jq3--lKa3hMmt5RXM1S1RrcEU/view?usp=sharing

    • @phaeton01
      @phaeton01 7 лет назад

      oh so it makes a difference which way round its plugged in?
      i fixed it by setting the damage to a negative number, the print string told me it was adding health

    • @unallocated7932
      @unallocated7932 7 лет назад

      yeah a big difference lol but dont worry im also new to this unless you count unity

  • @rishabhlaheja7689
    @rishabhlaheja7689 6 лет назад

    Your tutorials are really helpful...could u make a tutorial on hit reaction? The enemy attacking the third-person character and then the health reducing

  • @koski7579
    @koski7579 2 года назад

    i might be too late, but what if the enemy doesn't see player anymore? i have found absolutely zero guides about this

  • @markguilard
    @markguilard 3 года назад

    great tutorial, please letme know now how to make a game over, why did you made last things? when player is died the game must stop!

  • @TheSpecialOrange
    @TheSpecialOrange 6 лет назад +3

    When the AI kills you, how can I play the death animation that I have for your third person character?

    • @TheSpecialOrange
      @TheSpecialOrange 6 лет назад

      And Make the AI Have its own attack animation?

  • @BarbaNeggra
    @BarbaNeggra 7 лет назад

    worked perfectly, thanks!!

  • @XXALEXPROXX12
    @XXALEXPROXX12 8 лет назад

    Thanks dude you are awesome thanks for making this tutoriales , me and xendor are creating a game and if its posible we would like to hear your opinion about or idea , btw we are also gonna donate a little bit of money in order to help you in your patreon , hopes it helps a little bit , thanks again on the tutorials :D

    • @jaxonhandt6837
      @jaxonhandt6837 8 лет назад

      Happy to help! And yes I'd love to hear about it. You can email me personally at teamtitanicgames@gmail.com. And thank you so much for the donation, I truly appreciate it and hope that I can continue to help you and everyone else out.

    • @XXALEXPROXX12
      @XXALEXPROXX12 8 лет назад

      No problem dude! you helped us a lot and thats our way to thank you :D once we both agree on the main concept of our game im sure to let you know so you can give us your opinion , can you do a tutorial on how to add something like a death screen once your health bar is 0 ? or something cool like that :D

  • @khurramsa5133
    @khurramsa5133 7 лет назад

    can you telling me one important thing and please answer it tonight if it didnt bothering you, thing is i like to know when we design game levels like in level house inside geometry level which let player enter it by change level entity blue print command or level to level between gates like ( level one shore line>((change level through door))>level two stone town ,does these 2 levels are design in one game project or it requires 2 different project files and they're saved in unreal projects folder ? can you clarify this please.

  • @storingjazzinmycheeksforth5319
    @storingjazzinmycheeksforth5319 7 лет назад

    at the step shown in 1:27 i can't find 'cast to thirdpersoncharacter' and i did EXACTLY what he said. any help?

  • @mantronicsenterprises
    @mantronicsenterprises 7 лет назад +2

    The bug he encountered at 10:45 has been corrected in 4.16 so the AI does properly ignore the player after his health reaches 0, so his last addition of the branch should no longer be necessary.

    • @DavidWielerDev
      @DavidWielerDev 7 лет назад +7

      This is still happening in 4.16.2

    • @DavidWielerDev
      @DavidWielerDev 5 лет назад

      @The Fire Goat hey man. No sorry, I never could get it to work and ended up watching some videos by Virtus that did something similar and that worked. Do a search for “Virtus RPG game”

    • @DavidWielerDev
      @DavidWielerDev 5 лет назад

      @The Fire Goat was around episode 26, ruclips.net/video/z4CP2WsLxas/видео.html.
      I don’t think it’s going back to the original location, but it immediately sets the AI to start wandering again. Wouldn’t be too hard to add something to go back to its last location. Before moving to player location, set the current location to a variable, and after leaving the player location set the new MoveTo to the variable location, then fire the wandering function after.

    • @DavidWielerDev
      @DavidWielerDev 5 лет назад

      The Fire Goat I sub’d to your channel. Looking forward to seeing you build your game :)

  • @n1lknarf
    @n1lknarf 5 лет назад

    Hey there, could you please make a tutorial on how to stop pawns from pushing each other when they collide?

  • @andrewdalton6973
    @andrewdalton6973 3 года назад

    How do you make it where the Ai just damages you instead of patrol. I'm trying to make a zombie game, I'm having problems with this part. If I can get some help that would be awesome.

  • @Michael-gf1jn
    @Michael-gf1jn 8 лет назад

    Really good! Thank you!

  • @BasicallyImMac
    @BasicallyImMac 5 лет назад +2

    When I tried typed, Get to max health my variable didnt show up and I made sure it was saved and was a float

    • @kentt5563
      @kentt5563 4 года назад

      you may be on the AI character BP instead of Third Person character BP

  • @ehx3419
    @ehx3419 7 лет назад

    I saw you're using recursion to have the damage applied periodically. Now I'm using behavior trees, and BT tasks are known to be kinda buggy with event recursion. So how can I circumvent that?

  • @clebo99
    @clebo99 2 года назад

    Is it me or is this so much easier than behavior trees?

  • @Alex_Panagiotidis7
    @Alex_Panagiotidis7 3 года назад

    can you do after dieing have a pause menu wich will tell replay or exit to main menu plssss

  • @pupilmusic3197
    @pupilmusic3197 5 лет назад

    Hey, I know this is kindof an old video but how do I make the AI roam if it loses sight of the player.

  • @theplatypus104
    @theplatypus104 6 лет назад

    Only issue with this i've had is the fact the ai can damage you when its not touching you. for example if you stand on the cube it still damages you even though it's not at your location. Any advice?

  • @smi_e5898
    @smi_e5898 7 лет назад +1

    I'm trying to do the reverse. how would I get a projectile to damage and kill the AI and make it ragdoll.

  • @GummiDraco
    @GummiDraco 7 лет назад

    How would one apply damage to these AIs based on the Applying Damage Tutorial from your RPG Tutorial Series?

  • @johnfregoso04
    @johnfregoso04 6 лет назад +1

    You're a Savior m8

  • @TheGleb8
    @TheGleb8 7 лет назад +5

    Nice but the problem is that I was just copying. I dont understand 70% of what is happening in bp

  • @TimeoutMegagameplays
    @TimeoutMegagameplays 7 лет назад +3

    My Health Bar just drains when it reaches 0, before that it stays full, can someone help me please?

    • @harryhunt1735
      @harryhunt1735 6 лет назад +2

      skip to 1:51 Im guessing you divided the wrong floats

  • @TheSwordOfPalestine
    @TheSwordOfPalestine 7 лет назад

    i hope you make a tutorial show how to turn the player into ragdoll after the HP end . And thanks

  • @cyberiusdei2496
    @cyberiusdei2496 7 лет назад

    There seem to a problem. If I stand on a higher ground, when the AICharacter hits the wall (of the higher ground), it thinks it has reached me and start applying damage. Also I have set the movement to fly, but it only works work with patrol, chasing and random locations all seem to be ignoring z axis. Please help! :)

  • @dappercake5023
    @dappercake5023 3 года назад

    I know this is old, but does anyone know what to do when you break line of sight? When I side step the AI and they lose me, they just go to the world origin and stand there until i walk infront of them again. Any tips?

  • @인생의회전목마-l3i
    @인생의회전목마-l3i 7 лет назад

    what if I use player controller instead of character? "Player controller does not inherit from pawn" this error appears...plz help

  • @Nintender94
    @Nintender94 7 лет назад

    How would I design to open a scene after the AI drains all your health in the player character's progress bar and which blueprints would I use for that functionality?

    • @Nintender94
      @Nintender94 7 лет назад

      Never mind, I just used the branching described in the video.

  • @UB2K
    @UB2K 7 лет назад

    Hi nice video! thanks for the help. I have a slight problem though, the player loses damage when the character has stopped moving and is in the sights of an AI. BUT, the player still loses damage for example when it is at the opposite side of a fence, having no physical contact with the AI. How do we make it so that the AI has to be in physical contact with the player to lose health? Thanks :)

  • @parlonsen5923
    @parlonsen5923 5 лет назад

    do you know how we can make a charge nrj attack???

  • @edensagasta7735
    @edensagasta7735 7 лет назад

    Hi I followed your tutorial and I only have a doubt:
    I set and event when ai hit my player after chase my player plays animation and game stops and restarts but
    the problem is when ai hit my player keeps hit my player like looping thing and my character cannot play die animation and I still be able to move character so can you tell me how to fix this in order to make ai stop when hit my player and disable movement for my character as is dead (1 hit kills my character)

  • @WilliansBenites
    @WilliansBenites 7 лет назад

    how to add the attack animations and when it is receiving damage, make an animation and then the character can save himself from the attack ..

  • @AwakeningAnimations
    @AwakeningAnimations 6 лет назад

    This is nice and everything but this doesnt help much if we use our own character and animations because i have a melee attack but how to make the AI perform it when he reaches the player?

    • @dedosthreat493
      @dedosthreat493 6 лет назад

      On success - switch var to true casted to AnimBlueprint

  • @thatboi470
    @thatboi470 6 лет назад

    Now my problem: When my health reaches 0 the AI is still chasing me. I wasn't able to find the reason for this and I'm pretty sure I was following all the steps in this video. This was my first time creating an AI so it's likely I did a mistake (I'm using UE4.21.2. Maybe they changed something with the newer versions)
    Edit: If my AI is chasing me and I'm able to get behind it it will both stop roaming and chasing me

  • @harryhopkins3078
    @harryhopkins3078 7 лет назад

    i fucking fancy you

  • @clebo99
    @clebo99 7 лет назад

    I love these videos. So how do I destroy the ThirdPersonCharacter when my damage gets to 0?

    • @jacobbarrow532
      @jacobbarrow532 4 года назад

      do destroyactor at the end of the script

  • @codyw1730
    @codyw1730 8 лет назад

    Hi, these are some great tutorials here that don't use the annoying behavior tree, I've been struggling to get an AI system to work. I have one problem though. When my health, or in my case light power drops to zero the AI starts spinning in circles constantly. My set state is roam. I believe its calling the reset AI node constantly causing it to keep picking a new location every tick. Is there a way around resetting the AI without using a event dispatch? Also there is no activity on the Event Any Damage on the third person character.
    Example = drive.google.com/open?id=0B2zeI47OJUpabUNwdlVURjZFVFk

  • @uchihasasuke7863
    @uchihasasuke7863 7 лет назад

    The damage dealt is correct but after the duration of delay i lose all health

  • @MzTypeOHnegative
    @MzTypeOHnegative 4 года назад

    Love it, quick question. How would you add AFTER IMAGES or like a shadow effect to a paper 2d character as they move??

  • @brunomaes2103
    @brunomaes2103 3 года назад

    thank you help me so mush

  • @stringer4473
    @stringer4473 7 лет назад

    It doesnt do damage to me?? Any assistance would be really great!! The AI chase me, but they do 0 damage. I dont know why. Assistance please??

    • @HeyGuy393
      @HeyGuy393 3 года назад

      Idk if this helps but for me when i looked at my ai's blueprint for giving damage, i realized that my ai move to was linked to my delay, rather than apply damage like it should of been

  • @ikkisenjuro3729
    @ikkisenjuro3729 7 лет назад

    how to apply damage onto the AI? i want to deal dmg to the AI as well while also want to know how to make the enemy chase the player with delays (because using delay after apply damage on the AI doesn't work, it keeps on chasing and dealing dmg to player :c)

    • @DonMatek
      @DonMatek 7 лет назад

      Create a new projectile or use the on from template and add a Event Hit node with apply damage and destroy actor at the end. Then go to your AI character, set a new Variable as his health and add event any damage. Here is my graph of how damaged get's applied and after you check if AI is dead. Hope this will help you.
      imgur.com/a/aSS4c

  • @MzTypeOHnegative
    @MzTypeOHnegative 4 года назад

    Does this work for side scrollers?

    • @justklei5502
      @justklei5502 4 года назад

      no only works for first person and third person

  • @seanhoward9924
    @seanhoward9924 5 лет назад

    i followed this to a T but for some odd reason player dont get damage it takes none or if i get it to work it kills the whole health bar at once so i donno what i missed watched the video dozen times to find what i missed but no luck thanks for the leaning exp tho titanic

    • @ersel3825
      @ersel3825 4 года назад

      Same did you solve the problem?

  • @DragonPlayzYT
    @DragonPlayzYT 7 лет назад

    when i do event begin play it just brings me to the default one please help me

    • @MrSpecOps
      @MrSpecOps 7 лет назад +1

      You probably solved this already, but for anyone else who is wondering, UE4 functions with only one event begin play in this BP so that it doesn't end up with overlap bugs when the game starts. Just string them together.

  • @squadred1272
    @squadred1272 8 лет назад

    The roam works if i drag in an ai character but not when i spawn one in mid game any idea how to fix this?
    thanks

    • @titanicgames4785
      @titanicgames4785  8 лет назад +1

      A few things could be wrong. 1) Do you have the AI being possessed by an AI controller when it's spawned? That's very important. 2) Are you spawning them on the ground (and specifically ground with NavMesh)? I know there can sometimes be issues with spawning AI in the air and then they don't work so that could be the case as well. My best bet is that the AI doesn't have a controller when spawned.

    • @squadred1272
      @squadred1272 8 лет назад

      Thanks for the fast reply, i think the problem is its not being processed by an AI controller how would i set that up?

    • @titanicgames4785
      @titanicgames4785  8 лет назад +1

      Try this:
      Open the AI blueprint. Click on the (self) in the Components tab. In the Details panel on the right, search for "Auto Possess AI". There should be a drop down box of options for it. Change it from "Placed in World" to "Placed in World or Spawned."
      Hopefully that works!

    • @squadred1272
      @squadred1272 8 лет назад

      All sorted thanks for the help man really appreciate it keep up the great tutorials (;

  • @Raidbollen
    @Raidbollen 8 лет назад

    Thanks again for all tutorals about AI ^^ , i want ask you only a question, when i kill the enemy, how can i tell him to stop chase me? Becuase when he die he start follow me :(

    • @titanicgames4785
      @titanicgames4785  8 лет назад +1

      Hi there. What you can do is tell your AI to stop sensing you, like we did starting at the 8:00 mark except calling that functionality when the AI dies, and then you could destroy him, disable his movement, or tell him to enter a different state. I will make a tutorial to explain this a little more if that would help.

    • @Raidbollen
      @Raidbollen 8 лет назад

      i have try with UnPosses, destroy capsule component and work well at the moment.. ^^ But i prefer wait for your tutorial ^^
      And how can i make the enemy follow me when i shoot him?
      Thanks ^^

    • @Raidbollen
      @Raidbollen 8 лет назад

      How can i tell the enemy stop follow if i go behind wall? Because now if i go behind a wall he attack me ;(

    • @titanicgames4785
      @titanicgames4785  8 лет назад

      You'll need to do some more advanced behavior with behavior trees to accomplish that I believe, since the way we have it set up only allows us to do something when the enemy sees the player and not when they stop seeing them. I will look more into it and see if I can do some tutorials on better AI and behavior trees.

    • @Raidbollen
      @Raidbollen 8 лет назад

      +Titanic Games thanks for answer, i have try with different tutorial but the enemy have always some problem -.-..

  • @slothdude8109
    @slothdude8109 6 лет назад

    the enemy isn't applying damage Please help

    • @dedosthreat493
      @dedosthreat493 6 лет назад

      Did you follow the tutorial?

    • @slothdude8109
      @slothdude8109 6 лет назад

      @@dedosthreat493 uuuummmmm yeah

    • @dedosthreat493
      @dedosthreat493 6 лет назад

      @@slothdude8109 send me a photo of your blueprints at madatwoodentoys@outlook.com

  • @hurtlockergaminghd3822
    @hurtlockergaminghd3822 7 лет назад

    Maoooree AI videos please ;D

  • @ChrizzzpyHD
    @ChrizzzpyHD 7 лет назад

    I cant seem to find a "chase player" option...was that created?

  • @johndoe35717
    @johndoe35717 2 года назад

    uh so there no such thing as a canvas panel...

  • @sumitdebbarma1443
    @sumitdebbarma1443 6 лет назад

    Plz help i want to destroy my AI health bar when AI is death plz..... help me.....

  • @MrPoime
    @MrPoime 8 лет назад

    how can i add an animation to hit you if he catch you?

    • @titanicgames4785
      @titanicgames4785  8 лет назад

      Somewhere along the take damage event you could do a Montage Play function and then specify a montage to play for the hit. You'll need to get the Mesh and then get the Anim Instance of the Mesh to be able to call the MontagePlay function. I hope that helps point you in the right direction.

  • @Danlox
    @Danlox 5 лет назад

    he isn't doing any damage :(

    • @ersel3825
      @ersel3825 4 года назад

      Same did you solve the problem?

    • @Danlox
      @Danlox 4 года назад

      @@ersel3825 idk, not working on my game, sry

  • @gvm4817
    @gvm4817 6 лет назад

    thx!!!!!

  • @habibismassacre
    @habibismassacre 4 года назад

    AI doesnt kill me or attack me but it was doing it beforeeeeeee

  • @ahuman_4617
    @ahuman_4617 4 года назад

    The ai dint do damage

    • @ersel3825
      @ersel3825 4 года назад

      Same did you solve the problem?