Touch drag objects, raycast cant detect object?

Hi i’ve been working on a little game, which features a deck of cards and I want to be able to move the top card when I raycast from touch to it. I have tried implementing quite a few different things and have been searching online for hours trying to find out why it doesnt work. Currently I am using the following script for the raycast

Vector3 v3;
		if(Input.GetMouseButtonDown(0))
		{
			RaycastHit hit;
			//Debug.DrawRay(new Vector3(Input.mousePosition.x,Input.mousePosition.y,Input.mousePosition.z),Vector3.forward);
			Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
			Debug.Log("got past first if");
			if(Physics.Raycast(ray,out hit,1000))
			{
				Debug.Log("past second if");
				if(hit.collider.tag == "Ace")
				{
					toDrag = hit.transform;
					dist = hit.transform.position.z - Camera.main.transform.position.z;
					//v3 = Vector3(Input.mousePosition.x, Input.mousePosition.y, dist);
					v3.x = Input.mousePosition.x;
					v3.y = Input.mousePosition.y;
					v3.z = dist;
					v3 = Camera.main.ScreenToWorldPoint(v3);
					offset = toDrag.position - v3;
					dragging = true;
					Debug.Log("sth is hit");

				}
			}
		}

		if (Input.GetMouseButton(0))
		{
			if (dragging)
			{
				v3.x = Input.mousePosition.x;
				v3.y = Input.mousePosition.y;
				v3.z = dist;
				v3 = Camera.main.ScreenToWorldPoint(v3);
				toDrag.position = v3 + offset;
			}
		}
		if (Input.GetMouseButtonUp(0))
		{
			dragging = false;
		}

The issue is that I dont even get past the second if, let alone the third. This implies the raycast is not even being cast, what could be the reason? there are no objects in front of the one i am raycasting to.

If Physics.Raycast is called, then the raycast is definitely happening; if it returns false (causing the second if not to be entered) that means it didn’t hit anything. Here are a few things to try, let us know how it goes:

  1. Remove the distance limit for the raycast
  2. Make sure there is a collider on the card deck
  3. Make sure the card deck, and none of its parents, have their layer set to Ignore Raycast