title: Raycasting only to a particular object
body: <p>I use the following to detect if something is in front of my avatar:</p>
  
  <pre><code>void Start()
  {
      Vector3 fwd = transform.TransformDirection(Vector3.forward);
  
      if (Physics.Raycast(transform.position, fwd, 10))
          Debug.Log("Something in front");
  }
  </code></pre>
  
  <p>Now, I am trying to find out if <em>only a specific object</em> is in front, for example another avatar with the name <code>Police</code> in the hierarchy:</p>
  
  <pre><code>public class CharAnim : MonoBehaviour
  {
  
    police = GameObject.Find("Police");
  
    void Start()
    {
        Vector3 fwd = transform.TransformDirection(Vector3.forward);
  
        if (Physics.Raycast(transform.position, fwd, 10))
            Debug.Log("Something in front");
    }
  
  }
  </code></pre>
  
  <p>However, from the documentation, I cannot see if it is possible to use this <code>police</code> variable to detect it through ray-casting, measuring distance to it, etc...</p>
  
  <p>How do I implement this?</p>