I have several scenes in 3D, and I want them to change after colliding the player with an object. How do I do this?

Preferably using Javascript, what script would I need, to change one script to another upon collision?

More specifically, every game level is made so that the character travels through a maze-type thing in order to collect crystal shards and the main goal - a marble. How can I make it so that the next level starts once the character collides with the marble?

Thanks in advance.

function OnTriggerEnter (other : Collider) {
Application.LoadLevel(“some scene name”);
}

Be sure to enable “Is Trigger” on the marble’s collider.

Unity Docs - Scripting: Collider.OnTriggerEnter

Unity Docs - Scripting: Application.LoadLevel