Random Instantiate

hey, Id like to make a game, where there is a bunch of planes, flying over an area, at random intervals but also speeding up. Any ideas?

Something like this should do it:

(note - has not been tested, was written straight into the answers box, so may need work - but the ideas are generally there)

It should speed up the respawn time by percentToLowerTime% every timeBetweenRespawnTimeChange seconds

Has a percentOffsetOfTime% variance in the standard time for that current wave speed

var meanRespawnTime : float = 10;
var percentOffsetOfTime : float = 25;
var percentToLowerTime : float = 75;
var timeBetweenRespawnTimeChange = 30;

var planePrefab : GameObject;

function Start()
{
    LowerTimeLoop();
    RespawnLoop();
}

function RespawnLoop()
{
    while(true)
    {
        var randOffset = meanRespawnTime * percentOffsetOfTime / 100;
        var timeToWait = Random.Range(meanRespawnTime - randOffset, meanRespawnTime + randOffset);
        yield WaitForSeconds(timeToWait);
        Instantiate(planePrefab);
    }
}

function LowerTimeLoop()
{
    while(true)
    {
        yield WaitForSeconds(timeBetweenRespawnTimeChange);
        meanRespawnTime *= (percentToLowerTime / 100);
    }
}