title: Mathf.Clamp is resetting my eulerangle to minValue in Unity 3D
body: <p><strong>Mathf.Clamp is resetting my eulerangle to minValue when it reaches the maxValue instead of constraining it at maxValue. I have tried This :</strong></p>
  
  <pre><code>            rotateX = Input.GetAxis("Mouse X") * senseX;
          player.transform.Rotate(player.up, Mathf.Deg2Rad * rotateX, Space.World);
  
          playerXRotation = player.eulerAngles;
  
          while (playerXRotation.y &gt; 180f)
              playerXRotation.y -= 360f;
  
          Debug.Log("Y Rotation: " + playerXRotation.y);
          playerXRotation.y = Mathf.Clamp(playerXRotation.y, lowLimitY, highLimitY);
          player.transform.eulerAngles = playerXRotation;
  </code></pre>
  
  <p><strong>And This :</strong> </p>
  
  <pre><code>         rotate = Input.GetAxis("Mouse X") * senseX;
           rotation = player.transform.eulerAngles;
           rotation.y += rotate * RateOfRotate;
  
           while (rotation.y &gt; 180)
           {
               rotation.y -= 360;
           }
           rotation.y = Mathf.Clamp(rotation.y, lowLimitY, highLimitY);
           player.transform.eulerAngles = rotation;
  </code></pre>
  
  <p><strong>Here my lowLimitY = 0 and highLimitY = 180 in both the cases; I am stuck at this and have no clue how to work around it. Any help will be appreciated.</strong></p>