D
Dennis

  • Sep 10, 2024
  • Joined May 24, 2022
  • Hi Anthony,

    As seen in the picture, a "Pause" screen is open, which is supposed to intercept all mouse clicks via an image with a raycast target. However, it also intercepts the zoom via the mouse wheel.

    Is there a setting for this? I also have screens where this should be intercepted. However, I would like to be able to determine myself what should be intercepted and when.

    Thank you 🙂

    https://freeimage.host/i/dwtB4oP

    • Switching to clamped solved the problem.

      Thank you :-)

      • Hi Anthony,

        I updated to the latest version today.
        I am using a boundary box collider and now have the problem that the camera jumps back and forth at the edge when it should stop.

        I also had to remove debug.log output that was still in the source code and spamming my log

        • Anthony,

          in the demo scene, both also work at timeScale = 0f.

          while I was starting to put the test scene together I noticed a raycast target image. That caused the problem and now it's fixed :-)

          I just don't understand why OneFingerDrag wasn't caught by the Raycast Target but TwoFingerDrag was.

          Thank you very much. Problem solved

          • Anthony

            The patch has fixed the problem with MoveCameraToInstant. 🙂
            Thank you very much.

            Unfortunately zooming still doesn't work. I have looked more closely at how I control this.

            I use 2 INPUTS with the Perspective Camera:

            Move: One Finger Drag => Translate (works with timeScale = 0)
            Zoom: Two Finger Drag => Translate (does not work with timeScale = 0, but works with timeScale = 1)

            • I am using a Macbook with a touchpad.

              This two components do not work when I set timeScale to 0:

              1. zoom with 2 fingers
              2. moving camera with
              cameraPerspective.MoveCameraToInstant(
                                  manualOffset, 
                                  cameraPerspective.FinalDistance, 
                                  manualRotation
                              );
              • Ok I tested that before and it didn't change anything. Now I know why:
                The value must now be about 3x as high to get the same distance.

                Thank you - solved my problem

              • Anthony,

                if I set the timescale from unity to 0 (pause), the OneFingerDrag still works but zooming via touch no longer works.

                Is it possible that scaled and unscaled time is used here?

                Can I influence externally which time is used, in the same way as Unity's ParticleSystem and animations work?

                My goal is that the camera control is independent of the pause mode. For this, the camera movements would have to depend on the unscaled time.

                Thank you
                Dennis

                • Anthony,

                  now I installed the latest version of touch camera pro and i cant set the followDistanceMultiplier

                  cameraPerspective.followDistanceMultiplier = MysticTD.Instance.Settings.zoomCameraToEntryDistance;
                  I want to zoom to an entry portal at the beginning of each level. The distance should be defined in game configs. This is why I want to set this by code

                  Thank you

                  • Anthony,

                    I kind of miss a guide to all the input settings.

                    For example: What does "Translate" do in detail? I try to add rotation by mouse (for desktop and touch). But currently I can only do try-and-error there. (so far also unsuccessful)

                    My trackpad from the Macbook is also ignored for finger gestures. So it seems not to be supported. Something like this could also be added

                    Thanks 🙂

                  • Hello Anthony,

                    we are very happy that we decided to use your Camera Framework. Thanks again for the flawless support when you want to use it for features that are not (yet) implemented.

                    Now we would like to extend the Camera movement beside WASD (from your Custom Examples) with the classic DragMove. I'm pretty sure you already have everything integrated for that through Mobile Support. I can't find any examples for it though.

                    Additionally I have a small request, because I always have to adjust this in the code as soon as I update your framework. Could you provide a checkbox in the inspector to remove the spacebar (toggle the camera mode)?

                    // my manipulation of your original code in every update
                    public static bool ChangePerspective(){
                    return false; //Input.GetKeyDown(switchPerspective) && !IsOverUI;
                    }

                    • 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

                      • 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.

                        • 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

                          • thank you - solved with example in custom control demo scene

                          • Thanks.

                            Fixed with blocking custom camera controls between OnFocusStart & OnFocusComplete on current version

                            • Ok, some more infos. Maybe this is the main problem here. (Based on older version because RotateFromVector() still exists)

                              Both events are fired if I use MoveCameratoInstant(Vector3).

                              After I enabled some logs in both events I figured out, that
                              cameraPerspective.MoveCameraToInstant(newPosition);

                              fires

                              Exoa.Events.CameraEvents.OnFocusStart
                              Exoa.Events.CameraEvents.OnFocusComplete

                              I need this function to move the cam by WASD as workaround, because your plugin ignores new inputsystem of unity.

                              If i disabled this line, flooding of events stopped

                                      private void Update()
                                      {
                                          var newPosition = Move(cameraPerspective.FinalOffset);
                                         // cameraPerspective.MoveCameraToInstant(newPosition);
                                      }

                              The given gameObject in Complete event is of course empty then. There is no focus 🙂

                              Is there maybe another (better) way to use WASD with pre-calculated vectors?

                              • I updated via Unity Package manager and CameraBase.RotateFromVector() still exists

                                Maybe I don't have the newest version now?

                                • Anthony,

                                  When a level starts in my game, a randomly generated maze is displayed. The cam then moves correctly from a static starting point via

                                          private void MoveToEntry()
                                          {
                                              var entryGameObject = LevelManager.Instance.CurrentMap.Waypoints.First().Transform.gameObject;
                                              cameraPerspective.FocusCameraOnGameObject(entryGameObject, true);
                                          }

                                  to the input object.

                                  Sometimes it happens that the function never ends and during gameplay the input is permanently scrolled to.

                                  My guess is that it happens when the distance is a bit bigger due to randomness and during the automatic movement to the input keys are already pressed by the player.

                                  Can I query if FocusCameraOnGameObject is finished or register a callback (onFinish)?
                                  (If possible i can block userinputs until FocusCameraOnGameObject finished)

                                  Thanks a lot

                                  Dennis

                                  Translated with www.DeepL.com/Translator (free version)