How to simulate friction on topdown KinematicBody2D

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Mateus Felipe C. C.

When using KinematicBody2D, most physics is going to be handled by code. However, for some reason, when using it on platform like games, there’s a little friction on moving. If I move my char to the left or right and release the button, the player won’t stop immediately, but instead it will have a little deceleration until stop. This behaviour can be seen in the “2D Kinematic Character Demo” and “2D Plarformer Demo”, both available as templates on Godot.

This, however, don’t happen with topdown view. As seen on “2D Kinematic Collision Demo”, releasing the button will make the player stop suddenly, without deceleration.

My question is: how may I make my player to have a little deceleration like in platform case?