diff --git a/Assets/Scripts/BaseCameraController.cs b/Assets/Scripts/BaseCameraController.cs index 9138d25558a756c9f971019d22d95ca84be249f9..195f4bdc2edc7be5b84336682747a671b19c6b84 100644 --- a/Assets/Scripts/BaseCameraController.cs +++ b/Assets/Scripts/BaseCameraController.cs @@ -81,7 +81,6 @@ public class BaseCameraController : MonoBehaviour // Disable collider while there is an ongoing animation collider.enabled = !HasOverriddenOnterpolators(); - mouseMovementEdges.DrawDebug(!IsUserControlEnabled() ? Color.yellow : waitForMouseOutsideEdges ? Color.red : Color.green); if (IsUserControlEnabled()) { // Keyboard input @@ -101,6 +100,7 @@ public class BaseCameraController : MonoBehaviour // Mouse input var mouseViewportPos = camera.ScreenToViewportPoint(Input.mousePosition); var mouseInputVector = mouseMovementEdges.GetOutOfBoundsDirection(mouseViewportPos); + mouseMovementEdges.DrawDebug(waitForMouseOutsideEdges ? Color.red : Color.green); if (waitForMouseOutsideEdges && mouseInputVector.magnitude == 0) { // If mouse input was disabled and mouse left edge zone, re-enable mouse input @@ -120,6 +120,10 @@ public class BaseCameraController : MonoBehaviour zoomInterpolator.targetValue += inputZoomDelta; } } + else + { + mouseMovementEdges.DrawDebug(Color.yellow); + } // Always interpolate zoom as that might be animted without user input enabled if (zoomInterpolator.running) diff --git a/Assets/Scripts/utils/Interpolator.cs b/Assets/Scripts/utils/Interpolator.cs index bfbb2436aec9a9016c9c45322a43ac9db50677b2..dd2238a210aad114ea2c431b6334963ba9bbdceb 100644 --- a/Assets/Scripts/utils/Interpolator.cs +++ b/Assets/Scripts/utils/Interpolator.cs @@ -53,7 +53,7 @@ public class Interpolator if (running) { currentValue = Mathf.SmoothDamp(currentValue, _targetValue, ref velocity, duration); - if (Mathf.Abs(velocity) < 0.01f) + if (Mathf.Abs(velocity) < 0.0025f) { running = false; currentValue = targetValue;