How do I restrict my character's movement to one axis?

oh it’s attached in the question, you can see it there. Again, at the current moment, it functions like crouching instead of sliding, while it increases the character speed to make it feel like a slide.