I'm making a prototype for my 2d top-down space game and I'm using area2d for my *ship object since most of its mechanics rely only in collisions. Is there a way i can slow down then stop my ship after it is launched, because as for now it just fly continuously. Here is my basic code:
var jump_speed = 500
var velocity = Vector2()
func get_input(delta):
if Input.is_action_pressed("click"):
look_at(get_global_mouse_position())
if Input.is_action_just_released("click"):
velocity = transform.x * jump_speed
func _physics_process(delta):
get_input(delta)
position -= velocity * delta```