by button do you mean the GUI.Button() function in the OnGUI() method? If so then you just wrap it in an if statement and inside the if statement you put the code to move your character.
void OnGUI()
{
if(GUI.Button(...))
{
// function to move character
transform.position = Vector3.Lerp(start, end, time);
}
}
↧