From cf69423136409f93c88befdc3d6dc872824a8a28 Mon Sep 17 00:00:00 2001 From: Ava Gaiety Wroten Date: Thu, 18 Jun 2020 16:56:42 -0500 Subject: [PATCH] Fixed smoothed axis continued movement bug --- Assets/Scripts/Turret.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Assets/Scripts/Turret.cs b/Assets/Scripts/Turret.cs index 9a4fc31..2f51c84 100644 --- a/Assets/Scripts/Turret.cs +++ b/Assets/Scripts/Turret.cs @@ -43,6 +43,8 @@ public class Turret : MonoBehaviour Vector3 getMovementVector() { if (chargeCounter.IsLevelWon()) return Vector3.zero; + if (isHorizontal && Input.GetAxisRaw("Horizontal") == 0) return Vector3.zero; + if (!isHorizontal && Input.GetAxisRaw("Vertical") == 0) return Vector3.zero; float x = isHorizontal ? Input.GetAxis("Horizontal") : 0; float y = isHorizontal ? 0 : Input.GetAxis("Vertical");