RaycastHit2D hit = Physics2D.Raycast(Input.mousePosition, Vector2.zero); if (hit.collider != null) { Debug.Log("Clicked on Object!"); }