It works while moving but it doesn't work when I release the button. I want it to slowly stop instead of stopping instantly but have 0 ideas instead of this
Here is the code:
if Input.isactionpressed("ui_up"):
moveAcl += 0.01
velocity = Vector2(1, 0).rotated(rotation)
if not Input.isactionpressed("ui_up") and moveAcl > 0:
moveAcl -= 0.02
velocity = moveandslide(velocity * moveAcl * 100)