AI hitting player + player's weapon

So my current problem is that the AI deals damage to my Player twice, once to my character, and another time to the weapon that my player is holding.


This is my AI’s Hand collision, I tried a Do Once, deal damage, then reset it off end collision but that didn’t quite work right.

Any Suggestions Appreciated


Here’s my weapon’s collision, the ‘swing’ is a boolean to when the weapon swings in anim notify

Hey @hiimdyro, thanks for posting on the forums!
Have you tried creating a conditional on making sure that it is just the player that is getting affected? You’d need to be very specific on what deals with weapon damage versus what’s dealing with player damage.
I hope this can help!
-Zen

1 Like

Check if OtherActor is the type of Actor you want to deal damage to.

Also reset only if the OtherActor is the same actor that you did damage to

1 Like

I don’t like the idea of triggering a gate on whether the weapon is hit or not, because that ends up being fragile when you drop your weapon, or if the enemy only hits you and not the weapon, and so on.

However, the hit event contains the component that is hit (and also the component of the enemy doing the hitting.) You could test that the component being hit is your body/capsule/skeleton (depending on how you detect it,) and not the weapon (or any other component.) You should also test that it’s the enemy weapon doing the hitting, and not their armor or rollerskates or body-slamming or whatever other components may be on an enemy.

The output pins you want to use are “Overlapped Component” (for you) and “Other Comp” (for enemy.)

1 Like

Thanks a lot! I forgot about the Hit event I was working on the hitbox and so I just used the same overlapping component event so, thank you.


I’ll repeat this when the AI damages me :slight_smile: