I have a script wich is suppoused to spawn 1 out of 2+ random GameObjects, but it keeps on repeating the process of spawning them. I would like them to spawn only once on void start.
public GameObject[] obj;
public float spawnMin = 1f;
public float spawnMax = 2f;
void Start () {
Spawn();
}
void Spawn()
{
Instantiate(obj[Random.Range (0, obj.GetLength(0))], transform.position, Quaternion.identity);
Invoke ("Spawn", Random.Range (spawnMin, spawnMax));
}