The script is attached to the camera.
var target:Transform;
private var z:float=0;
private var zoomSpeed:float=30;
function LateUpdate()
{
z = Input.GetAxis("Mouse ScrollWheel") * zoomSpeed *0.1;
transform.Translate(Vector3(0,0,z),Space.Self);
}
I want to limit the distance of the target and the camera between a maximum and minimum.How to do this?