Basically what I want is to convert the code below into 2D so that it can detect the 2d colliders tags that the ray hits. I had this working in my 3d project, however simply making everything their 2D counterpart does not work. If someone could help me I would be eternally grateful.
if (Input.GetMouseButtonDown(0))
{
RaycastHit hit;
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit))
{
if(hit.collider.tag == "whatever")
{
Do something;
}