Caiuse
1

Basically the illustration demonstrates what I'm trying to achieve, It may not even
be a case of changing the LookAt Target, but more changing the camera's rotation
to face the "top" on my GameObject, modifying the MouseOrbit.js.
In short: On zooming in using the mouse scrollwheel I want the camera to slightly rotate to focus on the top of the object, but at the same time be able to freely rotation around the same LookAt Target, Just like Unity's in built MouseOrbit.js
var target : Transform;
//distance vars
var distance = 40.0;
var minDistance = 3.0;
var maxDistance = 40.0;
var zoomDistance = 3.0;
function LateUpdate(){
var lookAt = target.position;
var lookAtTop = target.position + Vector3.up;
var position = Vector3(0.0, 0.0, -distance) + lookAt;
transform.position = position;
if (camera) {
distance -= Input.GetAxis("Mouse ScrollWheel") * Time.deltaTime * Mathf.Abs(distance);
distance = Mathf.Clamp(distance, minDistance, maxDistance);
}
}
Scribe
3
var maxview = 60; //the maximum field of view of the camera
var minview = 10; //the minimum field of view of the camera
var target1 : Transform; //the shape your looking at
var maxOffset = 1; //the maximum offset to look at the top of the shape
var minOffset = 0; //the normal Y offset
var Offset = 0.00; //the offset of the camera 2 decimal places for smooth curve
function Update () {
if (Input.GetAxis("Mouse ScrollWheel") < 0) { //if scroll is less than 0
Camera.main.fieldOfView += 1; //add field of view (increase sight
Offset -= 0.02; //number = maxOffset/(maxview - minview);
if(Camera.main.fieldOfView >= maxview){
Camera.main.fieldOfView = maxview; //clamp to max field of view
}
if(Offset <= minOffset){
Offset = minOffset; //decrease offset until min offset
}
}
if (Input.GetAxis("Mouse ScrollWheel") > 0) { //if scroll is more than 0
Camera.main.fieldOfView -= 1; //decrease field of view (zoom)
Offset += 0.02; //number = maxOffset/(maxview - minview);
if(Camera.main.fieldOfView <= minview){
Camera.main.fieldOfView = minview;
}
if(Offset >= maxOffset){
Offset = maxOffset;
}
}
var target2 = target1.position + Vector3(0, Offset, 0);
transform.LookAt(target2); //look at target + offset
}
hope this helps put this on your camera
Scribe
Apologies for not reading through all of your code. Can you not just lerp the look-at target and camera height as you come closer to the object? Alternatively you can set a position the object should attempt to move toward if you want a smoother movement.
var lookAt = target.position;
var lookAtTop = target.position + Vector3.up; // change this to whatever you like
var factor = Mathf.Clamp01(distance / zoomDistance);
lookAt = Vector3.Lerp(lookAtTop, lookAt, factor);
position.y = Mathf.Lerp(lookAtTop.y, lookAt.y, factor) / 2.0f;
transform.LookAt(lookAt);