diff --git a/Assets/Scripts/Config/GameConfig.cs b/Assets/Scripts/Config/GameConfig.cs index 549816b0549e72d189f05b1421187fa392c00cf2..d907e90332b78bd331188d3f29bd3d444f448c77 100644 --- a/Assets/Scripts/Config/GameConfig.cs +++ b/Assets/Scripts/Config/GameConfig.cs @@ -6,8 +6,8 @@ public static class GameConfig{ // Movement lerp constants public static readonly float MOVEMENT_SMOOTHING = 0.14f; - public static readonly float MOVEMENT_SMOOTHING_JUMP_SNAPSHOT = 0.14f; public static readonly float ROTATION_SMOOTHING = 720; + public static readonly float CAMERA_MOUSE_VERTICAL_MAX = 60; // Difficulty multipliers private static readonly DifficultyData EasyData = new(){ diff --git a/Assets/Scripts/Core/UI/Camera/CameraMouse.cs b/Assets/Scripts/Core/UI/Camera/CameraMouse.cs index 7465e5cabe25177df3e988428acf7948e7d96ce9..347e3c2d03a5c1dfd2b6139808d1bbf8aa999d77 100644 --- a/Assets/Scripts/Core/UI/Camera/CameraMouse.cs +++ b/Assets/Scripts/Core/UI/Camera/CameraMouse.cs @@ -16,12 +16,10 @@ public class CameraMouse : CameraFollowObject { protected void Update(){ if(GameController.instance.IsPaused) return; - transform.forward = offset.normalized; - mouseTurn.x += Input.GetAxis("Mouse X"); mouseTurn.y += Input.GetAxis("Mouse Y"); - mouseTurn.y = Mathf.Clamp(mouseTurn.y, -90f, 90f); + mouseTurn.y = Mathf.Clamp(mouseTurn.y, -GameConfig.CAMERA_MOUSE_VERTICAL_MAX, GameConfig.CAMERA_MOUSE_VERTICAL_MAX); Quaternion rotation = initialRotation; rotation = Quaternion.AngleAxis(-mouseTurn.y, Vector3.right) * rotation; @@ -32,12 +30,13 @@ public class CameraMouse : CameraFollowObject { bool hit = Physics.Linecast(target.position, targetPosition, out RaycastHit hitLocation, 1); if (hit) targetPosition = hitLocation.point; - transform.localRotation = rotation; + targetRotation = rotation; } protected new void FixedUpdate(){ - transform.position = Vector3.SmoothDamp(transform.position, targetPosition, ref velocity, followingTime); - // transform.localRotation = targetRotation; + transform.forward = offset.normalized; + transform.position = Vector3.SmoothDamp(transform.position, targetPosition, ref velocity, followingTime); + transform.localRotation = targetRotation; return; } }