tarek2 I actually asked a bit confused hahaha, I meant that instead of adding each shooter to attack, add the "shooter_team" family to attack the "shooter team" family If they are not on the same team
It took me quite a long to understand what you are trying to do but I think I finally got it, or I hope so:
So you are adding new object types to the project and you want to run one code base for all the objects through a family to avoid duplicating the same code for each object type?
To do that and to simply the picking for yourself is to create two families instead of 1. Add the variable "Team" to both families, but since an object cannot have repeated variables call them "Team1" & "Team2" but keep in mind that is the same variable.
Create:
Family1 -------- and Add variable "Team1"
Family2 -------- and Add variable "Team2"
For every object that you add to the project, you need to include them in both families. And set their Team.
For example, you add to the project "Shooter_3"
Add "Shooter_3" ----------------- > to (Family1 & Family2)
And Set "Shooter_3" Team variables to the exact same team name:
For example, it is for (Team = 1)
Set variable "Team1" = 1
Set variable "Team2" = 1
Another thing is, remember to do the same when you spawn any new instance, set both variables:
Set variable "Team1" = YourTeam
Set variable "Team2" = YourTeam
https://www.dropbox.com/scl/fi/hybo21shepp9oytl26rvv/Turret-Dont-target-friends2.capx?rlkey=b16nywwasp80yaje3eiqsahx3&dl=0