diff --git a/Assets/Scripts/Units/UnitMovementHandler.cs b/Assets/Scripts/Units/UnitMovementHandler.cs index 246fa0e..280b04f 100644 --- a/Assets/Scripts/Units/UnitMovementHandler.cs +++ b/Assets/Scripts/Units/UnitMovementHandler.cs @@ -64,8 +64,8 @@ namespace Reset.Units{ targetDirection = (Camera.main.transform.rotation * targetDirection.ToVector3()).ToVector2(); // Deadzone - if (targetDirection.magnitude < .08f) { - targetDirection = Vector2.zero; + if (targetDirection.magnitude < .1f) { + targetDirection = resolvedMovement.moveDirection.RawWorld; } // Set Raw Direction (this is used by the camera later) @@ -94,7 +94,9 @@ namespace Reset.Units{ newDirection = Vector2.Lerp(slerpedValue, lerpedValue, directionChangeDotLerp); } else { newDirection = Vector2.SmoothDamp(currentDirection, targetDirection, ref refVelocityDirectionChangingHardness, data.directionChangingSoftness.Value * data.airDirectionDecay.Value * Time.deltaTime); - } + } + + newDirection = Vector3.Slerp(resolvedMovement.moveDirection.World, newDirection, controls.rawMoveInput.magnitude); // Commit the new direction resolvedMovement.moveDirection.World = newDirection;