Rotate Around when pushing a button

I am trying to rotate an Object around the Y-Axis of another Object, 90 in one second (or another set amount of time) when I press a button. The rotation should be smooth though, not just "snap". Imagine playing a racing game where you just have to push one button in order to make a 90 turn around a sharp corner. (that's just a fictitious example, by the way). I tried

var target : Transform;
function Update () 
{
    if(Input.GetMouseButtonDown(0))
    {
      transform.RotateAround(target.position, Vector3.up,90*Time.deltaTime);
    }
}

but all it does is rotate the Object one frame every time I click the mousebutton. Is there an elegant way in Unity to do what I want? Or will I have to cook something up using a countdown variable or something? I know it's a simple question, but I need some help to get me started. Any help is much appreciated.

Try using

if(Input.GetMouseButton(0))

instead of GetMouseButtonDown. GetMouseButtonDown only returns the frame in which the button was pushed down, where GetMouseButton will return true if the mouse button is held down.

EDIT: Rotate 90 degrees smoothly on mouse button

function Update()
{
   if(Input.GetMouseButtonDown(0) && !(timer > 0))
   {
      timer = 1.5;
   }
   if(timer > 0)
   {
      transform.RotateAround(target.position, Vector3.up, 60*Time.deltaTime);
      timer -= Time.deltaTime;
   }
}

Hi,

Have you checked iTween? it allows to apply smooth and ease function to any transform manipulation.

I have post a full project using itween and similar rotation on someone post, that seems to answer your problem.

http://forum.unity3d.com/threads/72201-Simple-Robot-Arm-Making-3-objects-rotate-in-sequence-PLEASE-HELP

Bye,

Jean