Change scene using Colliders

I am trying to change scene when the player reaches a ladder. The ladders prefab name is “exit”, the FPS’s hierarchy name is “First Person Controller”, the scene I am in is called “Game” and the next scene is called “End Scene”. There is also currently an invisible capsule collider to be used as a collision trigger called “collider”. I have searched in multiple questions and the unity coding guide but I have not found any solution. I attempted OnTriggerEnter and OnCollisionEnter.

Hi DolphinDudeOne, to do that, it’s very simple : you have just to use OnTriggerEnter and a tag condition, next you call Application.LoadLevel(); and it’s done. In your case, it’s like that : `var levelName : String;

function OnTriggerEnter (collider : Collider) {

if (collider.tag == “tag of your capsule collider”) {

Application.loadLevel(levelName);

}
}`

But if you want to keep your fpsController, add a script that prevent the fpsController destruction, like that function Awake () { DontDestroyOnLoad (transform.gameObject); }

See here and here, it’s the scripting API documentation.

Sorry if I’m not good in english, i’m french…