About Moving Camera

Hello!

I'm a newbie in Unity3D.

Can anyone please tell me which function (or code) I should use if I want to move Camera to a certain point in a certain time?

Thanks in advance!

:p

function MoveObject (thisTransform : Transform, startPos : Vector3, endPos : Vector3, time : float) {
    var i = 0.0;
    var rate = 1.0/time;
    while (i < 1.0) {
        i += Time.deltaTime * rate;
        thisTransform.position = Vector3.Lerp(startPos, endPos, i);
        yield; 
    }
}

Which is used like this:

function Start () {
    yield MoveObject(Camera.main.transform, startPosition, endPosition, 3.0);
}

assuming that startPosition and endPosition are Vector3s containing the start and end positions respectively where you want the camera to move, and 3.0 is the number of seconds over which the move should occur.