Unity 2D Raycast Mouse
// detect object that was clicked using raycast
RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
if(hit.collider != null)
{
Debug.Log ("Target name: " + hit.collider.name);
}
Ori6151