How do I get move_and_slide to move by one-meter intervals?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MegaProgramGuy
extends KinematicBody

var vel = Vector3.ZERO
var frame = 0
var countingFrame = false

var gravity = 200
var speed = 200

onready var groundCheck = $GroundCheck

func _ready():
    pass
func _physics_process(_delta):
	    vel = Vector3.ZERO
    frame += 1

    if frame > 15:
	    frame = 1
	    countingFrame = false

    if Input.is_action_pressed("forward") and frame % 15 == 0:
	    vel.z -= speed
	    countingFrame = true
    if Input.is_action_pressed("backward") and frame % 15 == 0:
	    vel.z += speed
	    countingFrame = true
    if Input.is_action_pressed("left") and frame % 15 == 0:
	    vel.x -= speed
	    countingFrame = true
    if Input.is_action_pressed("right") and frame % 15 == 0:
	    vel.x += speed
	    countingFrame = true


    move_and_slide(vel, Vector3.UP)

    print(str(translation))

    if Input.is_action_pressed("ui_cancel"):
	    get_tree().quit()