work on switch to new input system

This commit is contained in:
2025-11-19 20:24:23 -08:00
parent 4de639cdd7
commit 80be13ce72
5 changed files with 236 additions and 17 deletions

View File

@@ -5,10 +5,10 @@ public class PlayerCam : MonoBehaviour
{
float sens;
public Transform orientation;
public Transform player;
float xRotation;
float yRotation;
float mouseX;
float mouseY;
public Vector2 lookInput;
public Transform wagonRot;
private Quaternion previousSourceRotation;
@@ -51,19 +51,19 @@ public class PlayerCam : MonoBehaviour
sens = Sensitivity.value;
if (canLook)
{
mouseX = Input.GetAxis("Mouse X") * sens;
mouseY = Input.GetAxis("Mouse Y") * sens;
yRotation += lookInput.x * sens * Time.deltaTime;
xRotation -= lookInput.y * sens * Time.deltaTime;
}
yRotation += mouseX;
xRotation -= mouseY;
xRotation = Mathf.Clamp(xRotation, -87f, 87f);
transform.rotation = Quaternion.Euler(xRotation, yRotation, 0);
orientation.rotation = Quaternion.Euler(0, yRotation, 0);
player.rotation = Quaternion.Euler(0, yRotation, 0);
}
}