Drag object relative to camera

I’m using the Vuforia AR library and I’m trying to let the user drag the object across the screen with their finger. I’ve tried all sorts of different methods but everything I’ve found only drags the object along the axis defined by the object and not the camera.

I’ve tried using Camera.main.tranform.forward which I think is the key, but I haven’t been able to implement it properly. Can someone kindly point me in the right direction?

Edit: This is the code I ended up using thanks to robertbu

[SOLVED]

using UnityEngine;
using System.Collections;
 
public class DragObject : MonoBehaviour 
{
    private float maxPickingDistance = 10000;// increase if needed, depending on your scene size
	
	private Vector3 startPos;
                 
    private Transform pickedObject = null;
     
    // Update is called once per frame
    void Update () 
    {
        foreach (Touch touch in Input.touches) 
        {
			//Create horizontal plane
			Plane horPlane = new Plane(Vector3.up, Vector3.zero);
			
            //Gets the ray at position where the screen is touched
            Ray ray = Camera.main.ScreenPointToRay(touch.position);
             
            if (touch.phase == TouchPhase.Began) 
            {
                RaycastHit hit = new RaycastHit();
                if (Physics.Raycast(ray, out hit, maxPickingDistance)) 
                { 
                    pickedObject = hit.transform;
					startPos = touch.position;
                } 
                else
                {
                    pickedObject = null;
                }
            } 
            else if (touch.phase == TouchPhase.Moved) 
            {
                if (pickedObject != null) 
                {
					float distance1 = 0f;
					if (horPlane.Raycast(ray, out distance1))
					{
						pickedObject.transform.position = ray.GetPoint(distance1);
					}
                }
            } 
            else if (touch.phase == TouchPhase.Ended) 
            {
                pickedObject = null;
            }
        }
    }
}

One solution is to use Unity’s mathematical Plane class. You construct the plane using the Camera’s forward and then use Plane.Raycast() to find the point on the plane. You should be able to borrow code from this answer (though you will need to make a few changes):

http://answers.unity3d.com/questions/486097/mouse-clicking-on-the-plane-and-drag-to-other-posi.html