Hello, I am making a game where enemies spawn after 300 seconds (5min) and in 3 second intervals (each enemy appears 3sec after each other). How would I go about writing this (Java) code? I was think about putting this code on an object so the enemies spawn from that object. Please help! Thanks.
I do not use javascript much, but here is the barebones idea:
public var enemy : GameObject;
function Start () {
yield WaitForSeconds(300);
InvokeRepeating("SpawnEnemy", 3, 3);
}
function SpawnEnemy() {
//Instantiate the enemy prefab
var enemyClone : GameObject = Instantiate(enemy, Vector3.zero, Quaternion.identity);
//More code to make the enemy do stuff...
}