- Home /
Script for counting number of Turrets and when I destroy all of them I go to the YOU WIN seine
hey this is my final question for the Worm game I am making. Here's the Question. Is their a script that can count all the enemies that I have which are 35 and when I destroy all of them I go to my. YOU WIN seine. Also, is their a way to make my game an .EXE file so even if people that don't have UNITY 3D they can play it. THANKS
Answer by Peter G · Apr 25, 2010 at 05:20 PM
To answer your first question.
function Update () {
var enemies : GameObject[] = GameObject.FindGameObjectsWithTag("Enemy");
if(enemies.Length <= 0)
Application.LoadLevel("WinScreen")
}
To use that tag all your turrets "Enemy" and when the die, destroy them or place another placeholder object in that isn't tagged enemy.
The second question: Go to "File/ Build Settings" and drag your scenes to the scenes window, select the file type you want to build it as(Windows Standalone) and hit Build.
Your answer
Follow this Question
Related Questions
Keeping score when object clicked and destroyed 2 Answers
Detecting when certain objects have been destroyed 2 Answers
Destructible Environment 1 Answer
count score start 0 2 Answers
How to keep score? 1 Answer