Hello, I need help as I am new into programming and I came up with a problem that I dont know how to solve. This is my idea.
Suppose there are 3 teams, A, B, and C. Only one character in each team, all AI. I need to determine a way in which each character knows what his closest character from other team is. For example, in a line there are A, then B 2 metters appart, then C 3 metters appart. So closest object for A is B, closest object for B is A, but closest object for C is B. I need this so then I will add a script to follow the closest target, thats not the problem now, the problem is I dont know how can I make it so each character detects closest target independent of the team the closest target is.
Should I make a blank script for each character, and then another script that everyone has, so that they determine which of the other targets is closest based on the blank script for each character? Maybe I am making it way harder than it is. So, help please.