var barrel : Transform;
function Spawn () {
yield WaitForSeconds (1.5);
Instantiate(barrel, transform.position, transform.rotation);
return;
}
Does nothing. I have a feeling i’m heading in the complete wrong direction. I’ve done some looking around and I’m having trouble finding something. I basically just need to spawn a barrel every blah blah seconds.
You have to call the function from somewhere before it will do anything. Also, what you have will only spawn once. (You can leave the “return” out at the end, since functions always return once they reach the end anyway.) I’d suggest looking into InvokeRepeating.