Sorry about not being clear about the last quesstion so lets try this again.
So in my game you need to destroy turrents and i want to know how to make a script that will change the level when i have destryed all thhe turrents.
A simple way to do that is to create an empty object (let’s call it “Enemies”) and child all turrets to it. Check transform.childCount in the “Enemies” script Update function: when it’s zero, load the next level - something like this (empty object script):
var nextLevel: String; // set the next level name here in the Inspector function Update(){ if (transform.childCount == 0){ Application.LoadLevel(nextLevel); } }
Here is another example:
//This code is untested, please click the thumbs up if I helped you
//Make sure you write the name of the next level.
var turret : GameObject;
var levelName : String;
function Update () {
if (GameObject.Find(turret) != null) {
Application.LoadLevel(levelName);
}
}