This is an old revision of the document!
RaycastHit2D
can be used in an if statement to tell if the raycast hit anything, or if it hit nothing.
Example:
RaycastHit2D hit = Physics2D.Raycast(someStartPoint, someDirection); if(hit) { Debug.Log("yaaay I hit something!"); }