title: unity Rotate between min and max distance
body: <p>I'm trying to make it possible to drag an object. This object can only rotate so much. (Similair to a door).</p>
  
  <p>Here is the code abit edited that rotates an object which works.
  I have 2 vectors for maxrotation and minrotation.</p>
  
  <p>This code will be called whenever the user is dragging the interactible object. (like update but only when dragged)</p>
  
  <pre><code>        if (GestureManager.Instance.IsNavigating &amp;&amp;
      HandsManager.Instance.FocusedGameObject == gameObject)
          {
              //speed and navigiation of rotation
              float rotationFactor;
              rotationFactor = ManipulationManager.Instance.ManipulationPosition.y * RotationSensitivity;
              totransform.Rotate(new Vector3(rotationFactor, 0, 0));
          }
  </code></pre>
  
  <p>It would be great if I could use an if statement here. And I tried quite some things but it's still not working. </p>
  
  <p>As stated the code paste here works. The object should be dragable but only up to a certain points.</p>
  
  <p>totransform is the transform that will be rotated</p>
  
  <p>Any ideas would be great and most appreciated.</p>
  
  <p>Kind regards.</p>