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

Поделиться
HTML-код
  • Опубликовано: 2 янв 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 :>

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

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

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

  • @vincentklapperich1177
    @vincentklapperich1177 9 месяцев назад

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

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

  • @360ca_la_carte5
    @360ca_la_carte5 Год назад

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

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

  • @petitcoke
    @petitcoke 2 месяца назад

    How do I also deal damage to the AI

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

  • @g.o.v_animations
    @g.o.v_animations 11 месяцев назад

    Great video. Thanks a lot.

  • @djsalis
    @djsalis Год назад

    Great video :)

  • @EllisM-y1e
    @EllisM-y1e 3 месяца назад

    does this work in third person?

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

    Good , keep going

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

  • @aleksboboychev
    @aleksboboychev Год назад

    Thank you!!!!!

  • @austynwiles5414
    @austynwiles5414 11 месяцев назад

    6:20