Interval of x seconds between two method invokes.
I have two similar spawn methods invoked in Start method in different scripts, currently they both are called altogether but I want them to be called one after another every 10 seconds.
I tried InvokeRepeating, creating timers but none of them seem to be working, is there any wayI can give the gap of 10 seconds between the calling of these methods?
void Start () {
Invoke ("spawn", .3f);
}
void spawn()
{
Instantiate (obj [Random.Range (0, obj.GetLength (0))], transform.position, Quaternion.identity);
Invoke ("spawn", Random.Range (spawnMin, spawnMax));
}
}
Comment