It is from godot 3 2d isometric demo
extends KinematicBody2D
# Member variables
const MOTION_SPEED = 16000 # Pixels/second
var to = Vector2()
var step = 10
func _physics_process(delta):
#move_and_slide(motion * MOTION_SPEED)
move(delta)
func _input(e):
if (e is InputEventMouseButton
and e.button_index == BUTTON_LEFT and not e.pressed):
var gmpos = get_global_mouse_position()
to = gmpos
print(' to:' ,to)
return
func move(delta):
var nto = (to - position)
if nto.length() < step :
return
move_and_slide(nto.normalized() * MOTION_SPEED * delta)