Constant Moving

This is probably the easiest thing to do in Unity, but i forgot how to do it.

function Update () {

if(Input.GetButtonDown("LeftB")){

transform.Translate(Vector3(-10,0,0) * Time.deltaTime); }

How do i make it that the object constantly moves until the Button is released?

thanks

You mean something like this?

var isMoved = false;

function Update () {

if(Input.GetButtonDown("LeftB"))
    isMoved = true;

if (isMoved)
     transform.Translate(Vector3(-10,0,0) * Time.deltaTime); 

if(Input.GetButtonUp("LeftB"))
    isMoved = false;

}