extends KinematicBody const SPEED = 32 var velocity = Vector3() func _ready(): pass # Replace with function body. #func _process(delta): # pass func _physics_process(delta): # move velocity = Vector3() if Input.is_action_pressed("ui_right"): velocity.x = 1 elif Input.is_action_pressed("ui_left"): velocity.x = -1 if Input.is_action_pressed("ui_down"): velocity.z = 1 elif Input.is_action_pressed("ui_up"): velocity.z = -1 # Do not multiply by delta when using move_and_slide() velocity = velocity.normalized() * SPEED move_and_slide(velocity)