GameObject Position !

Hi,I would when I clicking on a button first game object come to second game object position !!
please someone help me with that

so I would when I click on a button first game object get position of second game object and attach to it
please help

var firstObject:Transform;
var SecondObject:Transform;

function OnGUI(){

 if (GUI.Button(Rect(0, 0, 150, 50), "move first to second")){
//this will move it immediately not progressively
firstObject.position=SecondObject.position;

/firstone will become a child of the second
firstObject.parent=SecondObject;
}
}

//if you want the movement from the first to the second progressive you need to
1-check if the button was pressed : if yes “have a flag” like pressed=true.
call a function if yes.

2-Then create a function: to Move it depending a certain speed

I hope this helps

As far as i understand, you have a button and when you clicked this button, a game object returns position of the second game object, is not it?