- Home /
how to create Objectives
Hi im following the tutorial by tornado twins and i wanna make a mission so that when my worm kills 10 turrets itll bring him to a new scene where they can go to the next level. need a java script for the mission plz help
Asking the same question over and over isn't going to get you a better answer.
Answer by Noah-1 · Jan 31, 2011 at 05:02 AM
Hey ok I know how to solve that.
Well first create a tag for every turret. (for example "Turret1-Turret10")
function OnTriggerEnter (other : Collider) {
if other.compareTag (""Turret1) //Use the same code for your 9 normal turrets,it will destroy them.
Destroy (gameObject);
if (other.CompareTag ("Turret10")) { //For the last one justchange the reaction
Application.LoadLevel("Your level");
}
}
I hope it helps, Good Luck. Finish the script and add it to the worm.
hey i got 2 errors these were the errors
Assets/$$anonymous$$aterials/Target1.js(4,4): BCE0044: expecting (, found 'other'.
Assets/$$anonymous$$aterials/Target1.js(4,9): BCE0043: Unexpected token: ..
Your answer
Follow this Question
Related Questions
Missing Method Exception and Null Reference Exception 3 Answers
GAMEOVER SCRIPT for worm game 2 Answers
Turn colliders off in script 2 Answers
Having Trouble With "Worm" T_T Tutorial 2 Answers
shooting and seeing through walls. 1 Answer