Camera elements

I have created an animation in with the camera fly in to the menu. When I click Play, I want the camera to fly to an other place but it would do it. This the code I’m using.

var playing : boolean = false;

function OnMouseEnter()
{
//Change the text color of the test
renderer.material.color = Color.red;
}

function OnMouseExit()
{
//Change the text color of the test
renderer.material.color = Color.white;
}

function OnMouseDown()
 {
 	if (!playing) {
      playing = true;
      animation.Play ("LevelSelect");
      yield WaitForSeconds(animation.clip.length);
      playing = false;
   }
 }

Do I have to do something more?

First, I’m gonna assume that this script is on the camera. OnMousDown is called when the mouse is over the object the script is attached to, and only if it have a collider. So that’s gonna be a problem from the camera. I suggest you use that code :

function Update()
{
   if( Input.GetButtonUp(0) ) // mouse left button up
   // your code
}

If nothing happens, make sure you don’t have a Time.timeScale = 0 somewhere, check if your animation is correct in the animation pannel, verify that your camera does have an animation component with the animation “LevelSelect”, and that the name is right.

Thank you for the advice you gave. I’m sorry that I did not make it clear that the script is on the the 3D text(Play), does all that you told me still apply or is it changed now?