Unreal Engine 4 - AI Damage Player

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 พ.ย. 2024

ความคิดเห็น • 105

  • @curtisjones4428
    @curtisjones4428 8 ปีที่แล้ว +2

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

  • @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!!

  • @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 TH-cam.
    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

      th-cam.com/video/68KSATgkt6k/w-d-xo.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

  • @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

  • @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!

  • @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, th-cam.com/video/z4CP2WsLxas/w-d-xo.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 :)

  • @TheGleb8
    @TheGleb8 7 ปีที่แล้ว +5

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

  • @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

  • @rishabhlaheja7689
    @rishabhlaheja7689 5 ปีที่แล้ว

    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

  • @kajli3894
    @kajli3894 6 ปีที่แล้ว

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

  • @Michael-gf1jn
    @Michael-gf1jn 7 ปีที่แล้ว

    Really good! Thank you!

  • @johnfregoso04
    @johnfregoso04 6 ปีที่แล้ว +1

    You're a Savior m8

  • @BarbaNeggra
    @BarbaNeggra 6 ปีที่แล้ว

    worked perfectly, thanks!!

  • @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.

  • @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?

  • @n1lknarf
    @n1lknarf 5 ปีที่แล้ว

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

  • @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

  • @Alex_Panagiotidis7
    @Alex_Panagiotidis7 3 ปีที่แล้ว

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

  • @thatboi470
    @thatboi470 5 ปีที่แล้ว

    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

  • @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

  • @TheSwordOfPalestine
    @TheSwordOfPalestine 7 ปีที่แล้ว

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

  • @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??

  • @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 :)

  • @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

  • @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?

  • @pupilmusic3197
    @pupilmusic3197 4 ปีที่แล้ว

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

  • @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?

  • @theplatypus104
    @theplatypus104 5 ปีที่แล้ว

    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?

  • @WilliansBenites
    @WilliansBenites 6 ปีที่แล้ว

    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 ..

  • @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.

  • @clebo99
    @clebo99 2 ปีที่แล้ว

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

  • @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 5 ปีที่แล้ว

      On success - switch var to true casted to AnimBlueprint

  • @Chickentwn
    @Chickentwn 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.

    • @Chickentwn
      @Chickentwn 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 ^^

    • @Chickentwn
      @Chickentwn 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.

    • @Chickentwn
      @Chickentwn 8 ปีที่แล้ว

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

  • @인생의회전목마-l3i
    @인생의회전목마-l3i 7 ปีที่แล้ว

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

  • @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)

  • @parlonsen5923
    @parlonsen5923 4 ปีที่แล้ว

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

  • @ehx3419
    @ehx3419 6 ปีที่แล้ว

    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?

  • @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?

  • @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! :)

  • @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.

  • @brunomaes2103
    @brunomaes2103 3 ปีที่แล้ว

    thank you help me so mush

  • @codyw1730
    @codyw1730 7 ปีที่แล้ว

    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

  • @harryhopkins3078
    @harryhopkins3078 7 ปีที่แล้ว

    i fucking fancy you

  • @clebo99
    @clebo99 6 ปีที่แล้ว

    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

  • @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?

  • @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

  • @stringer4473
    @stringer4473 6 ปีที่แล้ว

    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

  • @uchihasasuke7863
    @uchihasasuke7863 7 ปีที่แล้ว

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

  • @MzTypeOHnegative
    @MzTypeOHnegative 4 ปีที่แล้ว

    Does this work for side scrollers?

    • @justklei5502
      @justklei5502 4 ปีที่แล้ว

      no only works for first person and third person

  • @squadred1272
    @squadred1272 7 ปีที่แล้ว

    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  7 ปีที่แล้ว +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 7 ปีที่แล้ว

      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  7 ปีที่แล้ว +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 7 ปีที่แล้ว

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

  • @hurtlockergaminghd3822
    @hurtlockergaminghd3822 7 ปีที่แล้ว

    Maoooree AI videos please ;D

  • @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.

  • @gvm4817
    @gvm4817 6 ปีที่แล้ว

    thx!!!!!

  • @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.....

  • @slothdude8109
    @slothdude8109 5 ปีที่แล้ว

    the enemy isn't applying damage Please help

    • @dedosthreat493
      @dedosthreat493 5 ปีที่แล้ว

      Did you follow the tutorial?

    • @slothdude8109
      @slothdude8109 5 ปีที่แล้ว

      @@dedosthreat493 uuuummmmm yeah

    • @dedosthreat493
      @dedosthreat493 5 ปีที่แล้ว

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

  • @ChrizzzpyHD
    @ChrizzzpyHD 7 ปีที่แล้ว

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

  • @habibismassacre
    @habibismassacre 4 ปีที่แล้ว

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

  • @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

  • @MrPoime
    @MrPoime 7 ปีที่แล้ว

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

    • @titanicgames4785
      @titanicgames4785  7 ปีที่แล้ว

      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.

  • @ahuman_4617
    @ahuman_4617 4 ปีที่แล้ว

    The ai dint do damage

    • @ersel3825
      @ersel3825 4 ปีที่แล้ว

      Same did you solve the problem?