Hey, I’ve been following some tutorials, and I finished the mouse looking script. When I run the script, the x and y axis are sort of reversed. Like when I slide left and right on with my mouse it looks up and down, and when I slide up and down, it looks left and right…? Can anyone help?
`
pragma strict
var lookSensitivity : float = 5f;
var xRotation : float;
var yRotation : float;
var currentXRotation : float;
var currentYRotation : float;
var xRotationV : float;
var yRotationV : float;
var lookSmoothDamp : float = 0.1;
function Update () {
xRotation -= Input.GetAxis("Mouse X") * lookSensitivity;
yRotation += Input.GetAxis("Mouse Y") * lookSensitivity;
xRotation = Mathf.Clamp(xRotation, -90, 90);
currentXRotation = Mathf.SmoothDamp(currentXRotation, xRotation, xRotationV, lookSmoothDamp);
currentYRotation = Mathf.SmoothDamp(currentYRotation, yRotation, yRotationV, lookSmoothDamp);
transform.rotation = Quaternion.Euler(currentXRotation, currentYRotation, 0);
}
`