I am trying to move a player in a direction using the keys, i need control the object between two vectors, i am testing this code:
velocity = Vector3(0.1,0.5,0)
if Input.is_action_pressed('ui_right'):
velocity.x += 1
global_translate(velocity)
if Input.is_action_pressed('ui_left'):
velocity.x -= 1
global_translate(velocity)
The problem is that the player is changing of position, i want move only between two points.