Camera Movement (One Position to Another)

I just got into Unity a few days ago and am having a problem with the camera. I was trying to make a script that would have the camera go from one position to the next. My only problem is I’m horrible with Javascript/C#.

I do have a script from someone else but can’t get it to work. Can you help?


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; 
}

}

The function seems ok. But it need to be called at some point. Only some functions are called by Unity (Start, Awake, Update etc)