- Home /
Scene Switching?
I am using the first person controller. I want it so if the character touches a cube it will go to a different scene. Is there any code?
Answer by aldonaletto · Jun 04, 2011 at 11:31 PM
You can use OnTriggerEnter:
function OnTriggerEnter(x:Collider){
if (x.name == "Player"){
Application.LoadLevel("(fase name)");
}
}
Don't forget to rename the player to "Player", and to check the Is Target checkbox in the cube collider.
Answer by dj1437 · Jun 04, 2011 at 11:34 PM
Is ("(fase name)") where i put the scene number? I mean like replace fase name.
Please forgive me - fase is the portuguese word we use for level! Yes, you should use something like this:
Application.LoadLevel("Level2");
where Level2 is the name of the new level.
Your answer
Follow this Question
Related Questions
do you know what version of unity was released in the end of 2012? 0 Answers
Unity script to open a new scene 3 Answers
how to switch between scene 4 Answers
Photon Network Switching Scenes with Keeping Script Values 0 Answers
switching levels 2 Answers