Is there away that I can get a random value each time coroutine is started? For example, I have 10 assets and each time coroutine starts, I want it to spawn a different one. Problem is that when I use random.range as coroutine parameter, it only gets one random number the first time, therefore choosing only one asset and spawning only that one asset throughout the game. Here’s the code
void Start(){
StartCoroutine(SpawnObjects(meteors[Random.Range (0, meteors.Length - 1)], 10, 3f, 3f, 15f, Objects.METEOR));
}
meteors[Random.Range(0, meteors.Length - 1)] - the part I need help with