Drag And drop objects mouse

im trying to make a script where if you look at a object you can press a button e.g M you can move that object anywhere you want

please help

thanx in advanced

#pragma strict

private  var screenPoint:Vector3 ;
private  var offset:Vector3;
function  OnMouseDown() { screenPoint = Camera.main.WorldToScreenPoint(gameObject.transform.position);

offset = gameObject.transform.position - Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z));
}

function OnMouseDrag() 



{  var curScreenPoint:Vector3 = new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z);

var curPosition:Vector3   = Camera.main.ScreenToWorldPoint(curScreenPoint) + offset;
transform.position = curPosition;
}

You Can Use This OK !!!

Pick the object with Physics.Raycast then move it with Plane.Raycast, the plane being defined by the initial position of the object and the vector initial pos → Camera.