Animating Between LookAt() targets

Is there anyway to animate between different LookAt() targets. I want a nice smooth animation (Lerp?) between the targets.

Here is my simple script that is switching the camera targets…

var defaultTarget : Transform;
var bowTarget : Transform;
var sternTarget : Transform;
var skyDeckTarget : Transform;

function LateUpdate () { 
	
    if (MainGUI.defaultCamera == true) { 
		camera.main.transform.LookAt(defaultTarget);
    }

    if (MainGUI.bowCamera == true) { 
		camera.main.transform.LookAt(bowTarget);
    }

	if (MainGUI.sternCamera == true) { 
        camera.main.transform.LookAt(sternTarget);
    }

	if (MainGUI.skyDeckCamera == true) { 
        camera.main.transform.LookAt(skyDeckTarget);
    }

}

Thanks in advance,
Adam

There’s a SmoothLookAt script in the Standard Assets package. Here’s a copy of it:

var target : Transform;
var damping = 6.0;
var smooth = true;

@script AddComponentMenu("Camera-Control/Smooth Look At")

function LateUpdate () {
	if (target) {
		if (smooth)
		{
			// Look at and dampen the rotation
			var rotation = Quaternion.LookRotation(target.position - transform.position);
			transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * damping);
		}
		else
		{
			// Just lookat
		    transform.LookAt(target);
		}
	}
}

function Start () {
	// Make the rigid body not change rotation
   	if (rigidbody)
		rigidbody.freezeRotation = true;
}

Wow, don’t know how I missed that… Thanks!

Super-easy to integrate into what I had.