title: Unity Raycast Ignores LayerMask
body: <p>for some reason my raycast hits objects, that are in another layer.</p>
  
  <pre><code>private int obstaclesLayerMask = (1 &lt;&lt; 11) | (1 &lt;&lt; 12);
  private Vector3 GetPointOfContactNormal()
  {
      Ray ray = new Ray(transform.position, transform.forward);
      if (Physics.Raycast(ray.origin, ray.direction, out hit, obstaclesLayerMask))
      {
          Debug.Log(hit.collider.gameObject.name);
          return hit.normal;
      }
  
      return Vector3.zero;
  }
  </code></pre>
  
  <p>I`ve tried changing layerMask to random layers even the ones not specified like 1 &lt;&lt; 30 and tried to use LayerMask.GetMask() instead, but raycast still hits objects. Only setting layerMask to default layer like 1 &lt;&lt; 0 made raycast ignore collisions.</p>