- Home /
How can i switch to the next level after completing the task in level one?
please give a code or a tutorial on how to do this.. please..
Answer by Ardeni · Aug 09, 2013 at 08:16 AM
Add simple boolean var, for example "taskcompleted" to your script and change them to true after some task, next add something like ths to update(); :
if(taskcompleted == true)
{
Application.LoadLevel ("Level2");
}
In this case Level2 is the name of your next scene to load. That's all.
Answer by Kobohdashi · Aug 09, 2013 at 08:53 AM
The way I did it was I made a cube and set it as trigger, then add this script
//Script for next level
var levelToLoad : String;
function OnTriggerEnter(hit : Collider)
{
Application.LoadLevel(2);
}//END FUNCTION ONTRIGGERENTER
now just un-tick the mesh render in the inspector to make the cube transparent. When your player runs into the trigger the next level will load.
Your answer
Follow this Question
Related Questions
One small change for many scenes? 2 Answers
Tile Based Leveling 0 Answers
Save information on Level Load HELP 1 Answer
How Do You Make A Script Start Another Scene/Level? (And Add A Delay For Something In A Script?) 1 Answer
Should player & pickups be children of the level, or keep them separate? 2 Answers