title: Unity RayCasting Not Working
body: <p>I will explain my scene first. So I have a Character being controlled by the User in a 2D Scenario with following components attached to it, they are RigidBody2D, BoxCollider2D, and a Circle Collider near the Feet. Now I have another Similar(Same Components) Character for which I am trying to program AI  so  I am Using the following code to do so </p>
  
  <pre><code>void Update(){
     eyeRay();
  }
  bool eyeRay ()
  {
      Ray eye = new Ray (Head.transform.position, transform.localScale.x == 1 ? Vector3.right : -1 * Vector3.right);
      RaycastHit Hit;
      Debug.Log ("0");
      if (Physics.Raycast (eye, out Hit, Mathf.Infinity)) {
          Debug.Log ("1");
          if (Hit.collider.gameObject.tag == "Player") {
              Debug.Log ("2");
              transform.position = Vector3.Lerp (transform.position, Hit.collider.transform.position, 0.5f);
              return true;
          }
          return false;
      }
      return false;
  }
  </code></pre>
  
  <p>Its is not even Printing "1" in the Console only "0"
  I also tried this with </p>
  
  <pre><code>RaycastHit2D Hit = Physics2D.RayCast(new Vector2(Head.transform.position.x, Head.transform.position.y), transform.localScale.x == 1 ? Vector2.right : -1 * Vector2.right, Screen.width/2f);
  if(Hit.Collider.tag == "Player"){
      //Do Something
  }
  </code></pre>
  
  <p>But Nothing Happens</p>