Quantcast
Channel: Latest Questions by Daniel Girgis
Viewing all articles
Browse latest Browse all 22

delay first spawn

$
0
0

When I play the enemys spawn instantly from each spawnpoint then go to there normal delay time and i need a way to get rid of the first enemy spawned maybe a delay or a way to delete it.

Thankyou

var Enemy : GameObject;
var DelayMin = 5.0;
var DelayMax = 20.0;

    function Start () {
        SpawnRoutine();
}

    function SpawnRoutine () {
        while(true) {
        Instantiate (Enemy, transform.position, transform.rotation);
        yield WaitForSeconds(Random.Range(DelayMin, DelayMax)); 
    }
}

Viewing all articles
Browse latest Browse all 22

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>