Trouble with for loop out of range. Simple? Maybe.

So I have been staring at this code trying to figure out why it’s out of range.

I have 4 empty game objects as children in another empty object. Those 4 are tagged as “waypoint”. The parent has no tag. I am trying to store these 4 points in an array, then fill another array with their Vector3 coords to use as a waypoint system.
Please help? Probably an easy solution right in front of my face but I can’t see it.

function Start(){
	amountToMove = amountToMove * Time.deltaTime;
	waypoints = GameObject.FindGameObjectsWithTag("waypoint");
	
	for(var i : int = 0; i <= waypoints.length; i++){
		waypointVectors _= waypoints*.transform.postion;*_

* }*

}

This should hopefully fix it

function Start(){
    amountToMove = amountToMove * Time.deltaTime;
    waypoints = GameObject.FindGameObjectsWithTag("waypoint");

	//Always! Always! Instaniate an array.
    waypointVectors = new Vector3[waypoints.length];

    //You do not want to use <= as this will cause an out of range error.
    //i explained it in the bottom of my answe
    //for(var i : int = 0; i <= waypoints.length; i++){

    for(var i : int = 0; i < waypoints.length; i++){
       waypointVectors _= waypoints*.transform.position;*_

}
}
Also are you sure its attached to an Active GameObject in the scene?
Regarding this line:
for(var i : int = 0; i <= waypoints.length; i++){
What is happening is, that the waypoints.length will tell you the current amount of elements, so for this example say 10. Now you may think, 1 2 3 4 5 6 7 8 9 10, perfect! But you are wrong, it starts at 0!. So 0 1 2 3 4 5 6 7 8 9, see we have no 10! Now the check you had “<=” is testing for less than or equal to waypoints.length, the problem is, waypoints.length is showing 10, but we know the max is 9! Hence the reason we should only check for if it is less “<” than 10, hence 9.