I am working on a 3d platformer and I would like the player to be able to rotate their camera around the character and I have code that can do that but in my if statement to check for the movement of the (right) joystick it triggers no matter what numbers I put in as long as they are within the range of -1 to 1 which is the joysticks range. Thank you for any help that you may provide.
//rotation
if (Input.GetAxis("HorizontalRightStick") < -0.2)
{
transform.Rotate(-Vector3.up * RotateSpeed * Time.deltaTime);
}
else if (Input.GetAxis("HorizontalRightStick") > 0.2)
{
transform.Rotate(Vector3.up * RotateSpeed * Time.deltaTime);
}