Enemy A.I. Shooting Projectiles (+ Damage) | UE5 Tutorial

Поділитися
Вставка
  • Опубліковано 5 січ 2025

КОМЕНТАРІ • 31

  • @florismmsmit
    @florismmsmit 6 місяців тому +1

    amazing! you helped out a ton while making my game!

  • @pandalovercrumxoxo6637
    @pandalovercrumxoxo6637 Рік тому +3

    Thank you for the helpful tutorial also have a good rest of your day :>

  • @FactuallyWOW
    @FactuallyWOW Рік тому +2

    ive put this code into a trigger box so the enmy spawns every few seconds but the first one, when he is killed, doesnt stop shooting and just carries on until game over, cvan someone help

  • @jackmagic8420
    @jackmagic8420 Рік тому +9

    The way you have it set up, it damages the player right when the projectile spawns instead of when the projectile hits the player.

    • @BuvesaGameDevelopment
      @BuvesaGameDevelopment  Рік тому +3

      The way this is setup the player gets damaged like you said, thats correct. If you want on impact you add the damage node in the event graph of the projectile blueprint, right after 'event hit'

    • @flamelord_bradj
      @flamelord_bradj Рік тому +3

      @@BuvesaGameDevelopment I'm relatively new to ue5 so could I possibly have a more in depth explanation please, after the event hit in the projectile blueprint I hooked cast to firstpersoncharacter to the "other" node in event hit, then from there I applied damage. It doesn't do anything though.

    • @kurredev
      @kurredev Рік тому +2

      @@BuvesaGameDevelopment I have set the "apply damage" directly after event hit in the projectile code but it doesn't change from having it in the enemy code

  • @colespreier5648
    @colespreier5648 Рік тому +3

    What if they dont shoot at you and deal damage at all and they just look around?

  • @djsalis
    @djsalis Рік тому

    Great video :)

  • @vincentklapperich1177
    @vincentklapperich1177 9 місяців тому

    3:12 it wont let me use the get actor location and it doesent work

  • @bobarchitect7139
    @bobarchitect7139 6 місяців тому +1

    Usefull tutorial! once issue though, for some issue my enemy moves bit by bit when he shoots

  • @Its_Noctis
    @Its_Noctis 8 місяців тому +2

    this doesn't work... it deals damage regardless if the bullet hits the player or not, it damages you instantly when you're detected by the turret's line of sight...

  • @eraezr
    @eraezr 6 місяців тому

    With regards to the 'On See Pawn (PawnSensing) in Blueprint, I've read somewhere that Cast to BPs are computationally expensive, would that be true in this instance?

  • @g.o.v_animations
    @g.o.v_animations 11 місяців тому

    Great video. Thanks a lot.

  • @Jax1Million
    @Jax1Million Рік тому +2

    hi i wonder if you can help me, i have followed this tutorial, but my projectile applies damage to my 1st person character whenever it is spawned and there is now way to dodge it, i have tried making the collision on the projectile smaller and a couple of things but nothing seems to work can you give me quick advice here? or alternatively would be great if you made a tutorial about it. thanks brilliant work btw

    • @BuvesaGameDevelopment
      @BuvesaGameDevelopment  Рік тому +2

      You can spawn the projectile further away or 'ignore actor' and then your character

    • @Jax1Million
      @Jax1Million Рік тому +1

      @@BuvesaGameDevelopment yeah i tried a couple things but i have only been using ue5 for 3 weeks so I think i might just be missing something, thanks for reply though. I am subbed 😀😀

    • @Jay-og4yb
      @Jay-og4yb Рік тому +12

      Ik it's 6 month old comment but
      In enemy bp: Delete apply damage
      Open projectile bp
      In projectile bp: Event hit-> apply damage
      Damaged actor = hit actor
      In playerbp
      Click on capsule component, scroll to collision, check simulate hit events
      Should work

    • @naytbreeze
      @naytbreeze 6 місяців тому

      @@Jay-og4yb GOAT comment lol thanks

  • @360ca_la_carte5
    @360ca_la_carte5 Рік тому

    if i am moving in the air and it hits me nothing is happening plz help

  • @عبداللهشريف-ف7ع2ه

    Good , keep going

  • @Junpyclaps
    @Junpyclaps Рік тому +1

    I cant find the projectile in the spawn actor class can anyone help?😊

    • @Unorthodox_studio
      @Unorthodox_studio 5 місяців тому

      i think its called firstpersonprojectile or maybe you deleted. if you can't find, try making a new projectile blueprint with projectile movement and just copy the code over.

  • @petitcoke
    @petitcoke 2 місяці тому

    How do I also deal damage to the AI

  • @aleksboboychev
    @aleksboboychev Рік тому

    Thank you!!!!!

  • @EllisM-y1e
    @EllisM-y1e 3 місяці тому

    does this work in third person?

  • @austynwiles5414
    @austynwiles5414 11 місяців тому

    6:20

  • @JimmyShrimps
    @JimmyShrimps Рік тому +5

    Yeah, this doesn't work at all, you take damage if the projectile hits you or not and you're calling the ENTIRE character blueprint to do one damage calculation. I really don't mean to be rude or weird, or anything, but teaching people this will make very poorly optimized games.

    • @BerserkDestroyer
      @BerserkDestroyer 7 місяців тому

      is there a way to summon a variable from a player's blueprint without having to get the whole blueprint?

    • @Araphex
      @Araphex 6 місяців тому

      ​@BerserkDestroyer On Begin Play, get actor or actors of class. Set that actors blueprint there, and then set it as a variable. Use the variable going forward. It replaces casting as well (cast on Begin play, set as variable, also know as Safe Casting).