Don’t use the ui_… ones but the move_… that you have defined. It’s simply much cleaner, more descriptive and professional looking. At a later point you might allow to player to change their key-bindings, then changing just the move_… action is what you want to allow the player to do.
Ah yes that code isn’t mine, I took the snippet from another forum post here as an example of what I was talking about. I am planning to use the custom mapping for my inputs.
The first method adds deceleration when there’s no input by using move_toward(velocity.x, 0, SPEED), which makes movement feel smoother and more natural.
The second method directly sets velocity based on input. It works, but there’s no deceleration, which means movement stops instantly when input stops.