What i would do is define a velocity variable initializad on zero. On each phisics processing step (i assume player is kinematic body) ill move the player according the velocity. I would connect button_down
signal of the button to a function that sets velocity to the value expected in movement, and button_up
signal to a fucntion that sets velocity to 0.
Something like this:
extends KinematicBody2D
var velocity = Vector2(0,0)
func _physics_process(delta):
velocity = move_and_slide(velocity) #assuming top down game here
func _on_Button_button_down():
velocity =Vector2(100,0) # or whatever you want
func _on_Button_button_up():
velocity = Vector2(0,0)
This is only ilustrative. With more info perhaps i could help more.