Stop damage to self in multiplayer

Hello, I’ve set up my blueprints to replicate shooting, damage, etc in multiplayer. The damage/hit detect is determined using Sphere Overlap Actor and Apply Damage functions. This is all in a Projectile blueprint separate from MyCharacter. These features work fine.

However, I don’t want my bullets to hurt myself. Everything I’ve tried has led to one of the players being invincible or both. Sphere Overlap Actors has an Actor to Ignore option, but it doesn’t seem to work, since Get Player Character returns a static index, not the actual current character.

How do I go about making my projectile ignore its shooter? Is there a way to know which player character is which, and compare to see if the shooter of a projectile is the same as the one being hit?

Hi somelameguy, i’m working on melee combat in my project and have the same problem as you, did you find a solution or a method using blueprints?

Hi did anyone find a solution for this?

Set in bullet reference to your character, and when bullet damages someone, check if your reference equals damaged character (if true don’t make any damage)

this same method as well as some other are shown in this question from a few days ago.

hello, you could add a tag to your character and then maybe in the bullet’s blueprint, add an ActorAsTag node, if what hits does not have that tag then it can affect health, you can also use it to specify the characters not to hurt in a multiplayer

I have a really bad solution, but it works to some degree. Wish someone would present an actual solution to this issue, because I really don’t know how to handle figuring out who spawned the projectile because technically it’s always the server.

Anyway, here’s what I have.

I have my Character Blueprint which Spawns Weapon into the character’s hand, and I cast to the weapon to say “Fire” and the Weapon Blueprint spawns a Projectile Blueprint. So basically, Character > Weapon > Projectile.

What I did to prevent from shooting myself, but still being able to deal friendly fire damage, was this:

This is a really jank solution, but it’s all I could come up with.

There are 2 major issues.

  1. A player can still hit themselves if they’re moving fast enough or something.

  2. You still won’t be able to hit other people if you’re all stacked on top of each other or really close to each other.

Happy hunting,

-Metric