Hello Im trying to make 2 armies of units fight each other. So I have simple "Unit" that is like a Spearman. "Unit" is a Family I made in C3 in the layout there is 2 armies of Spearmen each in a line. On startup the "Units" move towards the opposite side and should detect any Unit that is on the other Team within range then call function "Attack" to the nearest enemy. The Attack would be a simple spawning of a Missile\attack sprite on the attacking Unit like a bullet.
I have tested this having Team 1 Units, Team 2 Units as family's and objects and it works. But If I use this method I have to have multiple Units for each team. There must be a way to do it by Comparing Variable Unit.Team not= to other unit.Team variable but I can not figure it out. ]
What is the best method of doing this?? Ill post a example If you dont understand what im asking.