var buttonx : int = -100
var buttony : int = 200
function OnGUI ()
if(GUI.Button(Rect(buttonx,buttony,100,200),"Some text is here..."))
//Whatever the button does is here.
The coding for however you want the button to move is elsewhere in the script. This is done by changing the values of buttonx and buttony in any way you want until you reach the button's destination.
To change the position of the button, continually change the value of buttonx and buttony in the Update() function, like you mentioned below. Here is an example:
if (buttonx < 100)
buttonx += 5 //Move the button 5 pixels per frame to the right until it reaches its destination (100).
if (button y < 300)
buttony += 5 //Move the button 5 pixels per frame downward until it reaches its destination (300).
May 25 '12 at 04:45 AM