title: Unity Physics2D.Raycast hits itself
body: <p>I'm trying to use <code>Physics2D.Raycast</code> in order to check if the player is on the ground (I know that there are other approaches to check if the player is on the ground but I think that the raycast is the most reliable).
  The problem is that in my scenario it returns the player itself as hit and I really don't understand why and what should I do.
  My code (in <code>PlayerController</code>) is the following:</p>
  
  <pre><code> public bool IsGrounded () {
          Bounds bounds = this.playerCollider.bounds;
          Vector3 rayOrigin = bounds.center;
          rayOrigin.y -= bounds.extents.y;
          RaycastHit2D hit = Physics2D.Raycast (rayOrigin, Vector2.down, 0.1f);
          if (hit.collider != null) {
              Debug.Log ("Collider is: " + hit.collider.name);
          }
          return hit.collider != null;
      }
  </code></pre>
  
  <p>And I can debug the casted ray using:</p>
  
  <pre><code>Debug.DrawLine (rayOrigin, new Vector3 (rayOrigin.x, rayOrigin.y - 0.1f, rayOrigin.z), Color.magenta);
  </code></pre>
  
  <p>...and it gets casted as expected, while the <code>Debug.Log</code> always reports "Player" which is itself and I don't know how it's possible. So what's wrong?</p>
  
  <p>ps. I'm using Unity 5.3</p>