You may want to use move_toward and a acceleration value, and only apply movement if there is a direction pressed.
I’ve never been a fan of seperating into a get_input function since it’s never used anywhere else, it’s just an extra function that drops the delta parameter.
func _physics_process(delta: float) -> void:
var rotation_input := Input.get_axis("rotate left", "rotate right")
# using math over if/else and use `delta`
rotation += deg_to_rad(2) * rotation_input * delta
var direction_input := transform.y * Input.get_axis("down", "up")
if direction_input:
# a good acceleration value may be 4 to 8 times speed, maybe 600
velocity = velocity.move_toward(direction_input * rocket_speed, acceleration * delta)
else:
velocity.y += gravity
move_and_slide()
Make sure to use proper formatting when pasting code