title: Why doesn't my Raycasting work in Unity3d?
body: <p>My raycasting dosen't seem to work when i assign it max distance, and works fine with infinite distance.</p>
  
  <p>Player is moving forward, and it touches the object but still no debug message. DrawRay draws a ray how its supose to.</p>
  
  <pre><code>void CastForwardRay()
  {
      int rayLength = 3;
      RaycastHit hitInfo;
      Ray ray = new Ray(rayCastTransform.position, rayCastTransform.forward);
      Debug.DrawRay(rayCastTransform.position, rayCastTransform.forward * rayLength, Color.white);
  
      if (Physics.Raycast(ray, out hitInfo, rayLength, playerLM))
      {
          if(hitInfo.collider.gameObject.tag == "Car")
          {
              print("hit a car");
          }
      }
  
  }
  </code></pre>