Is there a way to keep the PerspectiveCamera.FinalOffset fixed to its location while zooming in our out?

For example, if I place an object at the PerspectiveCamera.FinalOffset, then zoom in, you can see its position change relative to other fixed objects in the scene. How do I configure it to where it will zoom in and out with the FinalOffset as the fixed focal point?

Please see image. Thank you!

Moving FinalOffset

    heiser Hi!
    When zooming, a new focus point is calculated based on the center of the game view. You can block translation/rotation while zooming using code. Have you seen the "orbit_demo" scene?

      4 days later

      I took a look at the orbit_demo, that's what I want it to do, but what code do I need to use to ensure the focal point (FinalOffset) stays at the same location while zooming in/out?

      Here is the image I attempted to post last time: https://ibb.co/dccsmqQ

      Thanks!

        I'm sorry I don't understand what you mean. Maybe a video capture would help?

          24 days later

          I think I can explain it better...

          When I use the mouse wheel to scroll out, the FinalOffset appears to move towards the mouse cursor. If I want the FinalOffset to stay in the same spot while zooming in/out, I would need to hover the mouse cursor over the current FinalOffset location when moving the mouse wheel.

          How do I zoom in/out, keeping the FinalOffset at the same location regardless of where the mouse cursor or tap location is?

          Thanks!

            Thanks for re explaining. On the camera component (for example Perspective) there is a Scroll Wheel parameter where you can specify if you want to zoom "under mouse" or in "camera center".
            Otherwise you can also disable the camera translation, check the CameraOrbit scene and script 😉

              Write a Reply...