title: Raycasting in Unity 2D c#
body: <p>I'm new to c# and trying to figure out how to get raycasting to work here in Unity3d's new 2d support.</p>
  
  <p>I'm getting the error "cannot convert from 'UnityEngine.Ray2D' to 'UnityEngine.Vector2'"</p>
  
  <pre><code>for (int i = 0; i&lt;3; i ++) {
          float dir = Mathf.Sign(deltaY);
          float x = (p.x + c.x - s.x/2) + s.x/2 * i;
          float y = p.y + c.y + s.y/2 * dir;
  
          ray = new Ray2D(new Vector3(x, y), new Vector3(0, dir));
          Debug.DrawRay(ray.origin, ray.direction);
          hit = Physics2D.Raycast(ray.origin, ray.direction, Mathf.Abs(deltaY), collisionMask);
  
          if (hit != null &amp;&amp; hit.collider != null)
          {
          }
          if (Physics2D.Raycast(ray,out hit,Mathf.Abs(deltaY),collisionMask)) {
              float dst = Vector2.Distance (ray.origin, hit.point);
  
              if (dst &gt; skin) {
                  deltaY = dst * dir + skin;
              }
              else {
                  deltaY = 0;
              }
  
              grounded = true;
  
              break;
  
          }
      }
  </code></pre>
  
  <p>Can someone help me out?</p>