From bdc6b0636bdcaf84906e3d10f6306bf8ca574a2d Mon Sep 17 00:00:00 2001 From: Adrian Paschkowski <git@wasdennnoch.me> Date: Sun, 11 Apr 2021 18:22:42 +0200 Subject: [PATCH] Small fix to interpolator logic and typo --- Assets/Scripts/BaseCameraController.cs | 2 +- Assets/Scripts/utils/Interpolator.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/BaseCameraController.cs b/Assets/Scripts/BaseCameraController.cs index ca53edb..9138d25 100644 --- a/Assets/Scripts/BaseCameraController.cs +++ b/Assets/Scripts/BaseCameraController.cs @@ -72,7 +72,7 @@ public class BaseCameraController : MonoBehaviour void Update() { - if (Input.GetKeyDown(KeyCode.Z)) // TODO Remove evntually + if (Input.GetKeyDown(KeyCode.Z)) // TODO Remove eventually { var player = GameObject.FindGameObjectWithTag("Player"); AnimateToPosition(player.transform.position + new Vector3(0f, 0.75f), 1.5f, 0.1f); diff --git a/Assets/Scripts/utils/Interpolator.cs b/Assets/Scripts/utils/Interpolator.cs index a07a5c2..bfbb243 100644 --- a/Assets/Scripts/utils/Interpolator.cs +++ b/Assets/Scripts/utils/Interpolator.cs @@ -14,7 +14,7 @@ public class Interpolator set { var newValue = Mathf.Clamp(value, minValue, maxValue); - if (!Mathf.Approximately(newValue, _targetValue)) + if (!Mathf.Approximately(newValue, _targetValue) || !Mathf.Approximately(newValue, currentValue)) { _targetValue = newValue; running = true; -- GitLab