title: Raycast from Camera to Mouse Position in Game World
body: <p>When the mouse is at the Door (red area) i want to do something. I am trying to cast a Ray but the Ray doesn't hit the Door and i cant find where exactly it is hitting. Also how can i <code>Debug.DrawRay</code> this ray?</p>
  <pre class="lang-cs prettyprint-override"><code>Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
  RaycastHit hit;
  
  if (Physics.Raycast(ray, out hit, Mathf.Infinity)) 
  {
      if (hit.collider.tag == &quot;InteractiveDoor&quot;)
      {
          doorInteractGameObject.SetActive(true);
      }
      else
      {
          doorInteractGameObject.SetActive(false);
      }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/SNy8k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SNy8k.png" alt="Unity Img" /></a></p>