Space Shooter: I can't make the delay between asteroids spawning a float
Hi, I am just about done making the space shooter game, and I have this problem. The number of seconds for the delay between asteroids spawning for some reason must be and integer. To make the game more challenging, however, I need to make the delay between asteroids spawning a float (like 0.5). Any advice? Here's my code:
IEnumerator SpawnWave() { yield return new WaitForSeconds(startWait); while (true) { for (int i = 0; i < hazardCount; i++) { Vector3 spawnPosition = new Vector3(Random.Range(-spawnValues.x, spawnValues.x), spawnValues.y, spawnValues.z); Quaternion spawnRotation = Quaternion.identity; Instantiate(hazard, spawnPosition, spawnRotation); yield return new WaitForSeconds(spawnWait); // Here's where I think the problem is } yield return new WaitForSeconds(waveDelay); } }