My original post was closed before I could ask this so I am creating a new one.
I tried using several of the suggestions and am having issues. Any insight in to what I am doing wrong would be greatly appreciated.
I tried using:
var _targets : Transform;
But when I tried to drag and drop my corner game objects on to the elements in the inspector it will not take them. In other words I have the AI script on my enemy game object prefab. It has the AI script on it which has the variable _targets. I adjust the target size to 4. Then try to drag and drop the corner gameobjects on it.
How do I drag and drop the transform of a game object on to this in the inspector?
I also tried to do this manually in the script. I tried using.
var balls : ArrayList;
function Start()
{
balls = new ArrayList();
}
function Update()
{
cornerOne= GameObject.FindWithTag ("corner1");
cornerTwo= GameObject.FindWithTag ("corner2");
cornerThree= GameObject.FindWithTag ("corner3");
cornerFour= GameObject.FindWithTag ("corner4");
corner1 = cornerOne.transform;
corner2 = cornerTwo.transform;
corner3 = cornerThree.transform;
corner4 = cornerFour.transform;
balls.Add(corner1);
balls.Add(corner2);
balls.Add(corner3);
balls.Add(corner4);
}
However when I try to print whats in my array called balls. It just says “System.Collections.ArrayList”. It does not list any of the transforms I added to the array.
I am sure I have the context wrong but I am at a loss for where I am going wrong…