How Can I Rotate my object points

I have four waypoints; B,C,D,E script as following; I just want to rotate the object as well, how can I implement that?

    var pointB : Vector3;
    var pointC : Vector3;
    var pointD : Vector3;
    var pointE : Vector3;

   // private var endPos : Vector3 = new Vector3(0.0, 40.0, 0.0);
    function Start () {
    var pointA = transform.position;
    while (true) {
    yield MoveObject(transform, pointA, pointB, 3.0);
    yield MoveObject(transform, pointB, pointC, 3.0);
    yield MoveObject(transform, pointC, pointD, 3.0);
    yield MoveObject(transform, pointD, pointE, 3.0);

    }
    }
     
    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/8;
    thisTransform.position = Vector3.Lerp(startPos, endPos, i);
    yield;
    }
    
    
    }

If transform.up is generally aligned with Vector3.up (i.e. your points are generally aligned with the XZ plane, and if you mean by Left/Right that the game object is looking at the next point, then the above line of code will do the job. Or you could do:

transform.position = startPos;
transform.LookAt(endPos);