Move object with collision

hello guys

I'am new @ unity so i need some help. I want to move a object from point a to point b but this with a other object. For example:

My object a hand picks up a box then walks (or floats) from that point lets call it point a to a other point lets call it b. Then drops it or whatever. What is the best way to do this i'm somewhat formiliar with javascript and c#.

Any suggestions of samples

thnx in advance

var SpawnTo : Transform; //your hand

var Object1 : Transform; //what your picking up

var dist = 5; //distance at which you can pick things up

function Update () {


        if(Vector3.Distance(transform.position, Object1.position) < dist){

Object1.parent = SpawnTo;

Object1.transform.position = SpawnTo.transform.position;

Object1.transform.rotation = SpawnTo.transform.rotation;


i think this would work. basically it checks whether you pressed a button i chose 'Q' but you can choose whatever you want. it then looks at your distance from the object and whether you can "reach it" (in this case i chose a distance of 5)

if both of the cases are true the object is parented to the 'SpawnTo' which can be your hand and its position and rotation are also set to it.