Camera Zoom problem

I am trying to make a RTS camera script that uses the Middle Mouse Button to zoom the direction the camera is pointing, but don’t know how to make it not scroll past a limit (to prevent clipping through the building models, or zooming out to far). So far i have:

    if(curDistanceCam > camDistanceMin && curDistanceCam < camDistanceMax) {
        		Camera.main.transform.Translate (Vector3.forward * scroll);
        		}

But don’t know how to allow the camera to scroll back once it reaches the limits (it locks up)

curDistanceCam is a Ray distance between the camera and the object directly in-front of it.

Use Camera.fieldOfView . Default is 60 , setting it at a lower value will zoom in.