Random.Range spawning objects on top of eachother

Hello,

I’m new pretty new to Unity and having a great time trying to learn more.
Basically I’m trying to make a simple script that spawn random objects from an array. The problem is inside the invoke, which sometime makes the objects spawn on top of eachother. Is there a way to fix that, or is invoke simply the wrong approach here?

var obj : GameObject[];
var spawnMin : float = 1;
var spawnMax : float = 2;
 
function Start () {
	Spawn();
}

function Spawn () {
	Instantiate (obj [Random.Range (0, obj.Length)], transform.position, Quaternion.identity);
	Invoke ("Spawn", Random.Range (spawnMin, spawnMax));    	
}

In terms of better than chained Invokes(), you can use a coroutine:

function Spawn() {
    while (true) {
       Instantiate (obj [Random.Range (0, obj.Length)], transform.position, Quaternion.identity); 
       yield WaitForSeconds(Random.Range (spawnMin, spawnMax));
    }
}

As for not spawning on each other, there are lots of posts on the issue of preventing overlaps. Two common solutions are to 1) use Physics.OverlapSphere() to check to see there if anything is in the way and 2) going ahead and instantiating the object but leave the renderer off. On the next frame, the object check itself in OnCollisionEnter(). If there is a collision it destroys itself. If no collision occurs, it turns the renderer on.