new to coding and hoping someone could help
I’m trying to spawn a enemy , then once destroy another enemy will be spawned…and so on this is what i got so far
public GameObject spawnee;
public float spawnTime;
public float spawnDelay;
int maxEnemies = 1;
public static int enemyCounter = 0;
// Use this for initialization
void Start()
{
InvokeRepeating(“SpawnObject”, spawnTime, spawnDelay);
}
public void SpawnObject()
{
if (enemyCounter < maxEnemies)
{
Instantiate(spawnee, transform.position, transform.rotation); enemyCounter++;
}
}