title: Unity - raycast is clearly colliding but does not work?
body: <p>Ok I have 2 objects on the Default layer that I need to trigger a jump with when raycast collides. I can see that the raycast is intersecting the platform:</p>
  
  <p><a href="https://i.stack.imgur.com/8PD6l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8PD6l.png" alt="enter image description here"></a></p>
  
  <p>And here is my collider on the platform:</p>
  
  <p><a href="https://i.stack.imgur.com/QPHOz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QPHOz.png" alt="enter image description here"></a></p>
  
  <p>And yet nothing is printed with:</p>
  
  <pre><code>Vector3 rotation = transform.forward;
  
          RaycastHit hit;
          Debug.DrawRay(new Vector3(transform.position.x, transform.position.y + 0.4f, transform.position.z), rotation, Color.green);
          if (Physics.Raycast(new Vector3(transform.position.x, transform.position.y + 0.4f, transform.position.z), rotation, out hit, rayDistance))
          {
              print(hit.transform);
              if (hit.transform.GetComponent&lt;Platform&gt;() != null)
              {
                  Jump(hit.transform);
              }
          }
  </code></pre>
  
  <p>What is wrong here?</p>