help! I can't get an array from another script

at the end of the start function there is a function that says:

	var tunnels : tunnels = gameObject.GetComponent(tunnels);//name of script
	var nodes : Vector3[] = tunnels.nodes;//name of array

it returns… null reference exception-not set to instance of an object

and I can see in the editor prior to and during play, it clearly is an array with values. I just can’t seem to get it.

I attempted to wait yield 10 seconds before even calling the lines to get the array, but it says null reference exception straightaway as it loads.

this also returned a null reference exception:

if ( ntunnels.nodes[2] == null ){var test = Vector3.one;}

what am I doing wrong?

Your variable name is the same name as your type. Assuming your script name was “tunnels” and assuming that the script was attached to the same game object as the code above you can do:

var theTunnels : tunnels = gameObject.GetComponent(tunnels);
var notes = theTunnels.notes;