I'm making a multiplayer team tank game. Each game has a base and a turrets and the objective is to destroy the opposing team.
The number of teams is dynamic e.g. between 4-6 teams.
I'm now trying to build a turret that can detect a tank from an enemy team but leave a friendly team alone.
I've put the sprite ThisPlayer and Peer into a Players family, and added a family instance variable TeamID.
The turret also has a TeamID.
So I did this for events.
But the turret targets everyone in the Players family even though ThisPlayer and the turret's TeamID are the same.
What am I doing wrong?