Waypoint Coliider Error

Error message: gameObject is not a member of 'UnityEngine.Collider

Im going through a tutorial teaching me how to do waypoint AI pathing.

Heres all my code, Ive heard there can be issues will calling a GameObject, did I miss type something?

var neighbors:Collider[];

function Update () {

}
//the function to receive data
var countdown: int = 3;

function setData(incomingData)
{
	countdown = incomingData;
	countdown --;
	Debug.Log("the waypoint " + this.name + " sent the countdown of " + countdown);
	sendData();
}
function sendData ()
{
	if (countdown > 0)
	{
		for (var neighbor in neighbors)
		{
			neighbors.gameObject.GetComponent(Waypoint).setData(countdown);
		}
	}
}
//the function that sends data to the neighbors

var mask : LayerMask = 1 << 8;

var sphereDistance: int = 10;
private var breakWhile: int = 1;

function Awake () {
	while (neighbors.Length < 3 && breakWhile < 10){
		neighbors = Physics.OverlapSphere(transform.position,sphereDistance,mask);
		sphereDistance += 10;
		breakWhile ++;
	}
}

You don’t list the line number of the error, but it has to be line 22. You should be using ‘neighbor’ not ‘neighbors’ in this line.

  neighbor.gameObject.GetComponent(Waypoint).setData(countdown);

That is the for() loop is pulling out each entry in the array one at a time and assigning that one for the current iteration to ‘neighbor’. That single collider is what you should be referencing.