I got this script from a tutorial:
function Start ()
{
var targets = List;
AddAllEnemies();
}
function AddAllEnemies()
{
var mytargets : GameObject[] = GameObject.FindGameObjectsWithTag("Enemy");
for (GameObject in mytargets)
{
var enemy : Transform;
AddTarget();
}
}
function AddTarget ()
{
targets.Add(enemy);
}
Its supposed to put all enemies an a variable called targets, but its not working. Does anyone see something wrong with it. The problems are: "List doesn’t work so I know I have the wrong keyword, and because of that it can’t find the variable targets. And it says it can’t find the variable enemy.