Move the player by holding a UI Button?

I’m trying to make it so you can move the player with a UI Button, but it will only work for every time I press the button. How can I make is so the player moves WHILE I press the button, not WHEN I press the button? I also have an event trigger with Update Selected attached to the button.

 public float speed;

    public void moveRight()
    {
        if (Input.touchCount > 0)
        {
            Touch touch = Input.GetTouch(0);

            switch (touch.phase)
            {
                case TouchPhase.Began:
                    float moveRight = (Time.deltaTime * speed);
                    transform.Translate(moveRight, 0, 0);
                    break;

                case TouchPhase.Ended:
                    transform.Translate(0, 0, 0);
                    break;
            }
        }

Hello,

Find the attached [72570-moveplayerwhileholdingbuttonunitypackage.zip|72570] and you will have the solution. Let me know if any regards.