How to click and drag an object at full speed

I can click and drag my objects like I want but if I move my mouse to fast I lose the object and then I have to go click it again to drag it. How can I make sure my object stays with my mouse? Here is my current code;

if(Input.GetMouseButton(0))
	{
		var hit : RaycastHit;
		var ray : Ray = camera.main.ScreenPointToRay(Input.mousePosition); 
		if(Physics.Raycast(ray,hit))
		{
            if(hit.transform.gameObject == selectedObject)
			{
				selectedObject.transform.position.x = hit.point.x;
				selectedObject.transform.position.y = hit.point.y;
			}
		
		}

	}

Your problem is happening because the mouse is getting ahead of the object. When that happens, the Raycast() fails, so the drag stops. The only way I can think of to fix this problem is to change it so that the initial raycast starts the dragging, but after that it uses something else to move the cube. Here is my quick take on fixing the problem. The code got a whole lot more complicated, but I could not think of a simple fix:

private var dist : float;
private var toDrag : Transform;
private var dragging = false;
private var offset : Vector3;

function Update() {
	if(Input.GetMouseButtonDown(0))
	{
		var hit : RaycastHit;
		var v3 : Vector3;
		var ray : Ray = Camera.main.ScreenPointToRay(Input.mousePosition); 
		if(Physics.Raycast(ray,hit))
		{
		   if(hit.transform.gameObject == selectedObject)
		    {
		     	toDrag = hit.transform;
		     	dist = hit.transform.position.z - Camera.main.transform.position.z;
		     	v3 = Vector3(Input.mousePosition.x, Input.mousePosition.y, dist);
		     	v3 = Camera.main.ScreenToWorldPoint(v3);
		     	offset = toDrag.position - v3;
		     	dragging = true;
		    }
		}
	}
	if (Input.GetMouseButton(0))
	{
		if (dragging)
		{
			v3 = Vector3(Input.mousePosition.x, Input.mousePosition.y, dist);
			v3 = Camera.main.ScreenToWorldPoint(v3);
			toDrag.position = v3 + offset;
		}
	}
	if (Input.GetMouseButtonUp(0))
	{
		dragging = false;
	}
}

If your mouse pointer is getting ahead of the object thus losing the collider of the object here is an easy solution without offsets. The solution is that on mouse button down, store the last clicked object, and on mousebutton (constant execution) drag the object.

GameObject DraggedObj;

void Update()
{

if (Input.GetMouseButtonDown (0))
			{
					RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
					if(hit.collider != null)
					{
						if (hit.transform.gameObject.tag == "Card")
						{
						DraggedObj = hit.transform.gameObject;
						} 
					} 

			}

				if (Input.GetMouseButton(0))
				{
					if(DraggedObj != null)
					{
						Vector3 point = Camera.main.ScreenToWorldPoint(Input.mousePosition);

						point.z = DraggedObj.transform.position.z;

						DraggedObj.transform.position = point;
					
					}
				
				}
				else if (Input.GetMouseButtonUp(0))
				{

				OnMouseUp ();
				DraggedObj = null;
				}
}