var zoomLag:float = 0.5;

private var nextField = 50.0;
private var dampVelocityField = 0.4;

function Update () 
{
    var newField = Mathf.SmoothDamp(camera.fieldOfView, nextField, dampVelocityField, zoomLag);

    camera.fieldOfView = newField;
    
    if (Input.GetButton("Sights")) 
	{
        //adjust viewpoint and gun position
        nextField = 40.0;
		GetComponent(SmoothOrbitCamera).distance = 0.4;
    } 
	else 
	{
        //adjust viewpoint and gun position
        nextField = 50.0;
		GetComponent(SmoothOrbitCamera).distance = 1;
    }
}

@script RequireComponent(Camera)