How to make buttons move

I’m building a japanese study game and using buttons as the primary mode of movement between scenes. I’m working on a fade in. How do you make buttons move in from the sides?

Make a variable which changes as you want the button to move, and have the button appear off-screen. Here is an example (in Javascript).

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:

function Update()
{
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).
}
}

Would you then change the buttonx and buttony values in the update function? And how will it make a smooth transition instead of simply moving to the new location?