I'm making a 2D platformer. I move the player, a KinematicBody2D, using moveandslidewithsnap(). The player accelerates, instead of instantly moving at max speed, done using linear interpolation:
(velocity.x = lerp(velocity.x, dir * speed, acceleration)
Currently, when the player stands on a slope, they slide down, and when falling onto a slope they get a lot of horizontal speed, which is not what I want.
I have tried everything I can think of. stoponslope is set to true, I have tried setting the snap to some ridiculous amount, I have tried setting the maxfloorangle to different values, I have spent hours browsing the internet and looking at demos, but I found nothing.
The only answers I've found didn't really work for me, because they only work in situations where the movement doesn't have any acceleration, like in the Platformer2D demo (https://godotengine.org/asset-library/asset/120)
So my question is: Is there a way to solve this problem?