I am writing a very small project and I use moveandslide to move my character. But somehow it feels very "lagging" (allthough on the FPS counter you can see that it isn't actually lagging). It looks as if it collides with something for quite a while and after some time somehow resolves the collision. In the example below I always press right all the time, then left all the time, then right all the time etc. The moments where he halts I do not let go of the movement key and keep it pressed until it moves again.
Here is a gif of the behaviour: https://giphy.com/gifs/L0rpubzitsYILpAptx/fullscreen
(I tried to inline it but I had no luck, sorry)
Does anyone know what could be wrong?
EDIT: Full project, zipped: https://files.fm/u/32dw9mtm
The part where I use moveandslide, in my KinematicsBody2D node:
`
var velocity = Vector2()
func _physics_process(delta):
velocity.y += delta * GRAVITY
if Input.is_action_pressed("ui_left"):
velocity.x = -WALK_SPEED
elif Input.is_action_pressed("ui_right"):
velocity.x = WALK_SPEED
else:
velocity.x = 0
move_and_slide(velocity, Vector2(0, -1))``