title: Unity compiler thinks my position value is a bool?
body: <p>I'm attempting a hare-brained method of camera handling that doesn't involve collisions but just assigns boundaries in the context of a simple box world with two spheres bouncing around, one of which is the player. This is the code that I am attempting to run as my CameraFollow script:</p>
  <pre><code>public Transform player;
  public Vector3 offset;
  
  void Update()
  {
      Vector3 defaultPosition = player.position + offset;
      
      if (-497.5f &lt;= defaultPosition.x &lt;= 497.5f) {
          transform.position.x = defaultPosition.x;
      } 
      else if (defaultPosition.x &lt; -497.5f) {
          transform.position.x = -497.5f;
      }
      else if (defaultPosition.x &gt; 497.5f) {
          transform.position.x = 497.5f;
      }
  
      if (-497.5f &lt;= defaultPosition.z &lt;= 497.5f) {
          transform.position.z = defaultPosition.z;
      } 
      else if (defaultPosition.z &lt; -497.5f) {
          transform.position.z = -497.5f;
      }
      else if (defaultPosition.z &gt; 497.5f) {
          transform.position.z = 497.5f;
      }
  
      if (0.5f &lt;= defaultPosition.y &lt;= 1499.5f) {
          transform.position.y = defaultPosition.y;
      } 
      else if (defaultPosition.y &lt; 0.5f) {
          transform.position.y = 0.5f;
      }
      else if (defaultPosition.y &gt; 1499.5f) {
          transform.position.y = 1499.5f;
      }
    }
  }
  </code></pre>
  <p>The walls are at X +/- 500 with scale of 5, so 2.5 radius, thus the +/-497.5
  Ceiling and floor have scale of 1, floor is at 0, Ceiling is at 1500. You get the picture.</p>
  <p>The issue I'm having is that the Unity compiler (but not VSCode with Unity and C# plugins installed) is telling me that &quot;the '&lt;=' operator cannot be used on operands of type 'bool' and 'float'&quot;. Can anyone explain to me where this boolean value is coming from? The only booleans I can even see implied in this code are the output of the conditions of the if statements, but this boolean seems to be inside the conditions somehow. I'm confused.</p>