eror mesige in this short script

NullReferenceException: Object reference not set to an instance of an object controler.Update () (at Assets/controler.js:10)

public var curwp : Transform;
public var open : Transform[];

function Start () {
    open = GetComponentsInChildren(Transform) as Transform[];
}

function Update () {
    bestrate = 10000;
    for (var value : Transform in open){              <-------- hear
        ratesorce = value.GetComponent (score);
        if (ratesorce.ttlscr < bestrate){
            bestrate = ratesorce.ttlscr;
        }
    }
}

the eror mesige refers to the line with the arow. array seam to hate transforms

public var curwp : Transform;
public var open : Transform[];

function Start () {
    open = GetComponentsInChildren(Transform) as Transform[];
}

function Update () {
    bestrate = 10000;
    if(open!=null){
    for (var value : Transform in open){              <-------- hear
        ratesorce = value.GetComponent (score);
        if (ratesorce.ttlscr < bestrate){
            bestrate = ratesorce.ttlscr;
        }
    }
    }
}

The error message occurs when you try to access fields, properties or methods of an object which is null. An object is null before it's been instantiated, or if it gets assigned through a method call such as GetComponent, and GetComponent returned null.

Based on the answer by , open is non-null because the error still happens. Therefore, it looks to me like something inside the for-loop is null, i.e. probably ratesorce. Check that the call to value.GetCompoent(score) returns an object, and not null. (Do each of the transforms returned by GetComponentsInChildren have a score-component?) If not, ratesorce gets set to null, and the attempt to access "ratesorce.ttlscr" fails and throws the exception.

Note that GetComponentsInChildren doesn't do what you might expect it to - It actually returns all components of the argument type in both this GameObject, and whatever children it might have. Maybe that's what tricked you?