So I am making a GUI button and when it is held down it will not continue the action meaning i have to keep pressing it. How do I make it so when the button is being held down it continuous the action?

function OnGUI()
{
if(GUI.Button(new Rect(500,600,100,50),“Up”))
{
transform.Translate(Vector3(0,speed,0) * Time.deltaTime);
}
}

you need to use the GUI.RepeatButton function.