(fixed) How to eliminate Y velocity when sliding in a 2D plattformer?

Godot Version



Hello friends, I have a problem, if my character slides down a steep it builts up Y velocity and whichs turns into my character flying out of that slide, I want the character to stick on that “slide” and to constantly accelerate but only x velocity.
I have tried snapping to floor, setting the Y velocity to 0 any more ideas?

You should probably provide some code


I have found a fix already, but don’t know how to close thanks tho!