- Home /
Go To new Scene Button!
So Ive made a Cube then inserted this script into it
function OnTriggerEnter(goalCollision : Collider){ if(goalCollision.gameObject.tag == "Player"){
Application.LoadLevel("Parkour2");
}
Ive named the first person thing Player and the level Parkour2 is in build list thing but it dosent work...
is it a simple spelling mistake? ive checked trigger on my Cube. Also is it Java Script?
Are you seeing any error message in the Console? Try adding some Debug lines before the Application.LoadLevel, to see if the code is actually executing. e.g.:
function OnTriggerEnter(goalCollision : Collider) {
Debug.Log("Entered trigger");
if (goalCollision.gameObject.tag == "Player") {
Debug.Log("Collided with player");
Application.LoadLevel("Parkour2");
}
}
So you will see if the conditions are being met, and where the problem might be.
You say you've named your player "Player", but have you also tagged it as "Player"?
Im now trying to do the teleport thing to teleport me to the thrid level from the seconded level but its not working! ive tagged it and everything
Answer by EdocGaming · Mar 08, 2014 at 12:38 AM
You could try using the level id instead of the Level name Application.LoadLevel(2); replace 2 with your level id from the build list.
Your answer
Follow this Question
Related Questions
Open door = load scene c# issues 4 Answers
Scene Audio Script Error 2 Answers
How to load next scene on collision ? 3 Answers
Object reference not set to an instance of an object. 1 Answer
Scene Change Collision 2 Answers