Hello,
I am using CameraPerspective and the ResetCamera() call only works if the zoom has been changed, if only rotation has been changed the reset seems only to to 1 step then stops.
Sounds like a bug.
I need it fixed asap for a project!

Best Regards

    tabulatouch Hi,
    You are correct, it's because the reset feature completion is based on the camera position check regarding the destination position. The rotation is a side movement.

    I will try to fix that for the next update. For now you can easily change that on your side to make it send the completion event when the rotation move is done.

    Open CameraPerspBase.cs and add the onComplete event in the rotation Update line inside HandleFocusAndFollow()
    followMove.Update(ref followMoveRotation, focusTargetRotation, OnFollowFocusCompleted);

    And remove the one that is in the move Update:
    finalOffset = worldPointCameraCenter = followMove.Update(ref followMoveOffset, focusTargetPosition);

    Thanks for reporting

      Anthony
      Thank you so much

      Am I asking too much if you can send the edited file?
      So that i don't make mistakes.

      Best

        tabulatouch here is the function to replace:

           protected void HandleFocusAndFollow()
            {
                if (!isFocusingOrFollowing)
                    return;
        
                if (focusTargetGo != null)
                {
                    Bounds b = focusTargetGo.GetBoundsRecursive();
        
                    if (b.size == Vector3.zero && b.center == Vector3.zero)
                        return;
        
                    // offseting the bounding box
                    if (allowYOffsetFromGround)
                    {
                        float yOffset = b.center.y;
                        b.extents = b.extents.SetY(b.extents.y + yOffset);
                        b.center = b.center.SetY(groundHeight);
                    }
                    Vector3 max = b.size;
                    // Get the radius of a sphere circumscribing the bounds
                    float radius = max.magnitude * followRadiusMultiplier;
        
                    float aspect = cam.aspect;
                    float horizontalFOV = 2f * Mathf.Atan(Mathf.Tan(fov * Mathf.Deg2Rad / 2f) * aspect) * Mathf.Rad2Deg;
                    // Use the smaller FOV as it limits what would get cut off by the frustum        
                    float fovMin = Mathf.Min(fov, horizontalFOV);
                    float dist = radius / (Mathf.Sin(fovMin * Mathf.Deg2Rad / 2f));
        
                    focusTargetPosition = b.center;
                    focusTargetDistanceOrSize = Mathf.Clamp((dist * followDistanceMultiplier), minMaxDistance.x, minMaxDistance.y);
        
                }
        
                if (enableFocusing)
                {
                    finalDistance = followMove.Update(ref followMoveDistanceOrSize, focusTargetDistanceOrSize);
                }
                if (enableRotationChange)
                {
                    finalRotation = followMove.Update(ref followMoveRotation, focusTargetRotation, OnFollowFocusCompleted);
                    currentPitch = finalRotation.eulerAngles.x;
                    currentYaw = finalRotation.eulerAngles.y;
                }
                finalOffset = worldPointCameraCenter = followMove.Update(ref followMoveOffset, focusTargetPosition);
        
                finalPosition = CalculatePosition(finalOffset, finalRotation, finalDistance);
        
            }`

          Anthony Hello, and thank you.

          That problem seems to be solved.
          However, a major one is disrupting my experience.

          I need the two-pinch gesture to only ZOOM not drag the point of view , however it is happening both in ZoomAndRotate and ZoomOnly.
          If you just put fingers close enough and drag on screen, the zoom actually moves the point of view, like a translate.

          Also, is there a control on the smoothing of the zoom?

          Can you do something about it?

            tabulatouch Hi,
            If you setup Two Fingers Drag to None and Two Fingers Pinch to Zoom,it should not be translating. Now it's possible that the device send different positions for the fingers when you move, which is going to result in a different finger center point and make the camera translate yes. There is not much we gonna do about it.

            There is no smoothing or damping for now during the input phase, but that's something I started working on.

              Anthony

              Yes i think that is happening, mainly if you keep fingers too close.
              Some ideas:

              • disable translate completely (like in mouse wheel code)
              • reject two fingers pinch if they are too close: threshold
                Write a Reply...