title: Zoom in or zoom out Camera
body: <p>I have a ball which is focusing by a camera at random height and distance. On mouse scroll I want to zoom in-out my camera towards the ball. I have tried this weird code and its behaving weird as I expected.</p>
  
  <pre><code>void ZoomInOut() { 
      if(Input.GetAxis("Mouse ScrollWheel") &gt; 0){
          Debug.Log("mouse scroll wheel greater");
          distance += 20.0f;
          Vector3 negDistance = new Vector3(targetFollow.transform.position.x, targetFollow.transform.position.y, -distance);
          Vector3 pos = transform.rotation * negDistance + targetFollow.transform.position;
          transform.position = pos;
      }
      if(Input.GetAxis("Mouse ScrollWheel") &lt; 0){
          Debug.Log("mouse scroll wheel less");
          distance -= 20.0f;
          Vector3 negDistance = new Vector3(targetFollow.transform.position.x, targetFollow.transform.position.y, -distance);
          Vector3 pos = transform.rotation * negDistance + targetFollow.transform.position;
          transform.position = pos;
      }
  }
  </code></pre>