diff --git a/Assets/Script/Player/PlayerLook.cs b/Assets/Script/Player/PlayerLook.cs index 970c2666d1295df761bb446625e4a003ff6ae34e..1562dd9157a8cff50227b6b509cbe3c4f2160c94 100644 --- a/Assets/Script/Player/PlayerLook.cs +++ b/Assets/Script/Player/PlayerLook.cs @@ -11,6 +11,8 @@ public class PlayerLook : MonoBehaviour public float xSensitivity = 30f; private float ySensitivity = 30f; + public Transform joint; + void Start() { Cursor.lockState = CursorLockMode.Locked; @@ -25,6 +27,7 @@ public class PlayerLook : MonoBehaviour xRotation = Mathf.Clamp(xRotation, -80f, 80f); yRotation += mouseX * xSensitivity * Time.deltaTime; - transform.localRotation = Quaternion.Euler(xRotation, yRotation, 0f); + transform.localRotation = Quaternion.Euler(0, yRotation, 0f); + joint.transform.localEulerAngles = new Vector3(xRotation, 0, 0); } }