random.range update

//hello okay so i want to update the random range but i just dont know how to do it. here is what i have.

function Update(){
var meteorPos : Vector3 = Vector3(Random.Range(-8, 8), Random.Range(10, 20), 0); // declearing the random.range variable

}

// this is what i want the meteor to do

function MeteorRush(){

do{
Instantiate(meteor, meteorPos, transform.rotation);
yield WaitForSeconds (5);
}while (!gameOver);
}

// now i want it to spawn and do what i want.

function Start(){
MeteorRush();
}
//okay so what i need is a way to update the meteorPos variable while using it in other functions

declare the variable outside the functions, so other functions can use that variable.

It would also be better to change the value with the spawn of the meteor, so it just updates when it’s necessary. For now you update that value every frame which could be X times within a second. That’s not needed at all, cause your Meteor just spawns every 5 seconds.

many thanks! how dumb can i be see it clealy now when i read it again many thanks! :slight_smile: