So im reading a book called “Unity in action” and for the camara movement part (this is only to move up and down) there is this bit of code and it can be that im bad at maths or im missing something but if a -= b*c means a = a-(b*c) then if the mouse Y input is negative and the rotationX variable is already negative wouldn’t it result in a positive number? i mean -20 -= -0.5*10 would be *variable* = -20 -(-0.5 * 10) that would result in -20 + 5 right ? then why does the Y coordinate still go down when u get a negative Y input?
The piece of code is made bold btw.
else if (axes == RotationAxes.MouseY)
{
_rotationX -= Input.GetAxis(“Mouse Y”) * sensitivityVert;
_rotationX = Mathf.Clamp(_rotationX, minimumVert, maximumVert);
float rotationY = transform.localEulerAngles.y;
transform.localEulerAngles = new Vector3(_rotationX, rotationY, 0);
}
Sorry if this is confusing but im not the best at explaining things :/