• Touch Camera
  • Camera moves horizontally if reached max zoom distance

Hi Anthony,

we have another small problem. We use the WASD control from your custom controls demo scene.

That works so far also wonderfully.

But we use the zoom function from the standard controls of the camera (mouse wheel zoom).

When the game starts and you haven't even moved the camera (WASD) and zoom directly out, the camera moves horizontally when reaching the boundary and slows down until it stops (I think this is a lerp).

However, if I move the camera with WASD before and then zoom out, this does not happen. I guess this is because MoveCameraToInstant() was called for the first time after using WASD.

cameraPerspective.MoveCameraToInstant(
                    manualOffset, 
                    cameraPerspective.FinalDistance, 
                    cameraPerspective.FinalRotation
                );

I tried as a workaround in Awake and also in OnFocusComplete() simply to use

cameraPerspective.MoveCameraToInstant(
                cameraPerspective.FinalPosition, 
                cameraPerspective.FinalDistance, 
                cameraPerspective.FinalRotation
            );

to stop the camera from moving automatically when the maximum zoom level is reached. However, this leads to crazy behavior.

Thanks a lot
Dennis

    By the way, we didn't use the zoom from the custom controls because it behaves a bit differently than the built-in zoom.

    With the integrated zoom, the camera stops directly when the boundary is reached (or continues to move horizontally until the lerp ends).

    With the custom zoom I can zoom out as far as I want, as long as I keep scrolling. As soon as I stop scrolling, the cam resets to the maximum zoom. However, this allows the player to zoom out much too far.

      Thanks for reporting, I am remaking all these "move to" methods, I will keep you posted.
      Thanks

        5 days later

        Dennis Hi, I just posted a new updated on the asset store, it will be available in a few days:

        3.0.3

        • Fixed MoveCameraTo() and MoveCameraToInstant() to always clamp parameters within the inspector values.
        • Fixed MoveCameraTo() and MoveCameraToInstant() to wait for rotation, position and distance animations to end before triggering the completion callback.
        • Fixed MoveCameraToInstant() to make the changes instantly instead of waiting for a frame.
        • Fixed MoveCameraToInstant() to not invoke any event.
        • Added MoveCameraTo( Quaternion rotation )
        • Added MoveCameraTo( float distance )
        • Added MoveCameraToInstant( Quaternion rotation )
        • Added MoveCameraToInstant( float distance )
        • Updated Custom_Control and Move_To_Position demos
          2 months later

          Anthony,

          The problem with zooming out further has been fixed. Thanks a lot. 🙂

          On the 2nd point (moving the cam horizontally further when reaching the zoom limit).
          Here I am not sure if it is a bug or feature.

          My players have reported it to me as a bug.
          I zoom to the Boundary BoxCollider and then it keeps moving the camera. Sometimes forward, sometimes backward.

          It's not a high priority for me. If you can just stop it my players would be happy though.

          I attached a mov file with an example 🙂

          https://weird-chicken-games.eu/wp-content/uploads/2023/01/zoombug.mov

            Dennis Hi!
            Thanks for reporting, I will try to repro on my side. Would you be able to send me a unitypackage containing a scene, with the camera setup (to see all the variables you've set), your camera controller script if any, the bounding box, and without the Touch Camera script since I have them?
            Thanks!

              8 days later

              I just notice this behaivour on the touch camera lite, when I zoom out to the max distance, it start to drift horizontally, just a question this fix is also available on the touch camera lite? because I don't see that update on this one. Thanks

                Darkmax not yet but as soon as I get a fix, I will push it to both packages 😉

                  Darkmax can you share a demo scene with your camera setup? (and send the package to contact at exoa.fr)
                  thank you!

                    Write a Reply...