Camera zoom limit but with a Quanternion.Lerp in there. (RTS)

So I have been working on my Camera Controller and I have been having trouble implementing a zoom limit on the camera because the z position move as the y position moves to zoom in. I got it once but the camera started zooming in a weird way.

-Any help is appreciated =)

 private Vector3 _newZoom;
    [SerializeField]
    private Vector3 _zoomAmount;
    [SerializeField]
    private float _zoomMaxY = 55f;
    [SerializeField]
    private float _zoomMinY = 25f;
    [SerializeField]
    private float _zoomTime = 1f;
   
    void Update()
    {
        HandleKeyboardInput();
        HandleMouseInput();
    }
   
      private void Awake()
    {
        _newZoom = _cameraTransform.localPosition;
    }
    
     if (Input.GetKey(KeyCode.PageUp))
            {
                _newZoom += _zoomAmount;
            }

            if (Input.GetKey(KeyCode.PageDown))
            {
                _newZoom -= _zoomAmount;
            }
           
_cameraTransform.localPosition = Vector3.Lerp(_cameraTransform.localPosition, _newZoom, Time.deltaTime * _zoomTime);

If you want a true “zoom,” the reference way for that is simply to leave everything where it is, but to reduce the camera .fieldOfView property. While your game is running, you can trivially test it out by selecting the camera and wiggling the FieldOfView property in the inspector.

If you actually want a “dolly,” which involves moving the camera, the easiest way is to build an extra “dolly object” above your Camera in the hierarchy, and then drive that dolly object with the offset you want. When you’re done with the dolly-in, then return the local offset of that dolly object to (0,0,0)

ALTERNATELY, bust out Cinemachine and hook that up… it has a TON more cool camera-zoomy-camera-dolly etc functions in it and once you start messing with it, you’ll kinda get addicted to doing whacky complex camera stuff.