AI Projectile won't damage the player

Pre-warning, still somewhat of a novice when blueprint scripting, so I may not understand certain terminology used when any of you reply. I have a projectile set up so that when the AI fires it at the player, it’s supposed to damage the player. Most of the time, it won’t damage the player at all (I have set up a print string to display health throughout the entirety), and sometimes it will just insta kill the player without warning, for whatever reason. I did just plug the CastTo straight into apply damage, and that just dealt 60/100 damage straight away and then took nothing after. On those occasions where the player took damage, two more hits after and the game either suddenly stopped, or the player died. I just want to get the damage working and I was wondering if I could get any help as to how I can solve this? Below is a video of what is described above and a screenshot of the projectile code. If you need to see anything else just let me know! :slight_smile:

Your blueprint is a little bit weird, you loop over the enemy table and apply damage as long as Out Row Enemy Actor is not equal to the class of the actor you hit, if it’s equal you stop (the break does that)

So if you have let’s say three enemies in your table:

  • Enemy A
  • Enemy B
  • Enemy C

and you hit Enemy C you would apply the damage twice

  • Enemy A != Enemy C … do damage
  • Enemy B != Enemy C … do damage
  • Enemy C == Enemy C … Break

but if you resort the order of the enemies in the list the damage would change

  • Enemy A
  • Enemy C
  • Enemy B

hit Enemy C you would apply the damage once

  • Enemy A != Enemy C … do damage
  • Enemy C == Enemy C … Break

Probably only want to apply damage on the equal path and then break

That’s one thing.

The other one is the delay is problematic it would allow damaging the same target multiple times with the same object, you should store the damaged actors and not apply damage again.

To the strange and different behavior, I don’t see why it does no damage sometimes
but killing the enemy with multiple hits of the same object is very easy to achieve.