How to NOT apply damage to teammates/ally objects


I’m not sure which way i should handle damage to prevent damaging my teammates or ally objects.
I have projectiles + traces ingame… So whats the best approach to handle this behavior?

1. Comparing tags? If player from “team_1” shoot projectile, i will set tag to “team1” and then i will compare overlaps with this…

  • What im afraid of: I have shotgun so i can “get all actors with tag” and put it into ignore actors but is it OK to use this “heavy on performance” node every time i shot? Or i have to store all actors with that TAG in game mode?

2. Comparing actor variables? (lets say integers for teams) ?

3. Another setup?

I want to have correct dynamical setup (if mode will be FFA or 2 teams…).
Thanks for advices.

Lots of choices - a good one is to use the built-in insitigator pin when applying damage

Thank you, however before i apply damage, im calculating impact points (shotgun traces) or on overlap im spawning impact FXs so i need to ignore some actors before i do some logic… Before i compared owner with actor which worked well, but im doing more difficulty stuff now so i want to choose correct approach for this :slight_smile:

hmmmm If you want to be able shoot through your teammates, might be worth keeping array of actors on a team… perhaps have gamemode keep list of each team’s actors … then use that to filter LineTrace

In my game, I just assign characters to different teams. A projectile always knows who owns it, and if I know the owner, I can get the team number, and then when I’m looping through all hit objects, I compare team numbers to see if I should inflict damage or not.