Problem removing items from array

I have a problem removing items from an array. please help. Here’s my code:

var i :int;
var clone:GameObject;
var obj:GameObject[];
var spawnPoints:GameObject[];
spawnPoints=GameObject.FindGameObjectsWithTag("spawn");

function Start () {
    Call();
}

function Update () {

}

function Call(){
     yield WaitForSeconds(2);
     var randomPosition=Random.Range(0,spawnPoints.Length);
     var randomObj=Random.Range(0,obj.Length);
     //spawnPoints.RemoveAt(randomPosition);
     //var quest=spawnPoints[randomPosition];
     Debug.Log(Random.Range(0,spawnPoints.Length));

     clone=Instantiate(obj[randomObj],spawnPoints[randomPosition].transform.position,Quaternion.identity);
     clone.name="Object";
     obj.RemoveAt(randomObj);
}

Your first problem is that line 5 needs to be inside of the start function instead of on its own.

Second, the Debug.Log statement on line 21 doesn’t do what you expect, because it picks a new random number in that range. You probably want to replace that with
Debug.Log(randomPosition);

thanks for the response perchik hope it works