Quantcast
Channel: Questions in topic: "enemy"
Viewing all articles
Browse latest Browse all 1488

Change level once killed enemy

$
0
0
Hi guys I want to make it so the scene can change to another scene once i killed the last enemy. Here's my enemy spawner script public GameObject enemy; public Transform[] spawnPoints; public Vector3 spawnValues; public int howoften = 10; public int howmany = 3; public float etimer; void Update() { etimer = etimer - Time.deltaTime; if (etimer < 0) { etimer = howoften; int i = howmany; while (i > 0) { i--; int spawnPointIndex = Random.Range(0, spawnPoints.Length); Instantiate(enemy, spawnPoints[spawnPointIndex].position, spawnPoints[spawnPointIndex].rotation); } } }

Viewing all articles
Browse latest Browse all 1488

Latest Images

Trending Articles



Latest Images