Zooming out by moving camera away from target(scrollwheel)

Hi, I am making a small space ship simulator and I am trying to add zooming by scrollwheel. So far I got the zooming in right but zooming out doesn’t work. This it the code for zooming:

outTarget = transform.localPosition - transform.InverseTransformDirection(new Vector3(0,0,zoomScale));
		
		if(Input.GetAxis("Mouse ScrollWheel") > 0)// && zoom < 2)
		{
			
			transform.localPosition = Vector3.ClampMagnitude(transform.localPosition, transform.localPosition.magnitude - zoomScale);
			zoom+=1;
		}
		if(Input.GetAxis("Mouse ScrollWheel") < 0 )//&& zoom > -8)
		{
			transform.localPosition = outTarget;
			zoom -=1;
		}

where zoomScale is 3 and zoom is a control value I will use later on to control max and min zoom.

When I scroll down and am looking at the back of the spaceship(initial position of camera) it zooms out corectly but bhen I move the camera left(rotateAround() the target) for about 30 degrees the camera first zooms in rotating slightly to it’s initial position and then reaches the above mentioned margin of about 30 degrees and starts to zoom out again.

The script is located on the camera and the target is the center of the ship. The front face of the camera is the positive z axis.

Please help.

Maybe use fov of the camera: on mousewheel up increase the fov and on down reduce the fiv of cam