How do i get this to spawn over time?
Hi their. I am a super noobie programmer (mostly work as an artist) and i just wanted to ask how to spawn and arrangement of planets over time. Essentially the planets change as the player progresses through the level. I would really appreciate it. Since i really don’t have a clue on how to get started.
using UnityEngine;
using System.Collections;
public class PlanetSpawner : MonoBehaviour
{
public Transform [] spawnLocation;
public GameObject[] planetPrefab;
public GameObject[] whatToSpawn;
void Start()
{
spawnBluePlanet();
}
void spawnBluePlanet()
{
whatToSpawn[0] = Instantiate(planetPrefab[0], spawnLocation[0].transform.position, Quaternion.Euler(0, 0, 0)) as GameObject;
}
void spawnGreenPlanet()
{
whatToSpawn[1] = Instantiate(planetPrefab[1], spawnLocation[0].transform.position, Quaternion.Euler(0, 0, 0)) as GameObject;
}
void spawnOrangePlanet()
{
whatToSpawn[2] = Instantiate(planetPrefab[2], spawnLocation[0].transform.position, Quaternion.Euler(0, 0, 0)) as GameObject;
}
}