work on switch to new input system
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user