Changing Scenes on click

How would I get Unity to change between scenes when clicking on an object?

Right now I’ve imported the ClickToMove script on a sphere to play around with it, but I want to make it so that when the user clicks on the sphere, he or she is taken to a new scene, where they can choose to replace that sphere with another object, say a cube.

Thanks,
Damon Gogul

You can look here:

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
    void OnMouseOver() {
        if(Input.GetMouseButtonUp(KeyCode.Mouse0)){
		 Application.LoadLevel(sceneToLoad); 
	}
    }
}

this code is untested. all you need to do is make a script with it and add it to the player object (which has a collider)

Thanks for the code, but for some reason it can’t find the name of the scene I’m trying to load - do I have to set it as a directory path, or what?

Read these two:

http://unity3d.com/support/documentation/Manual/Publishing%20Builds.html

and as the last link states, you must have the level which you want to load checked in the build settings. (last link)

Thanks a lot, this solved my problem.

Damon Gogul