Limit the movement of an axis

There are options in the Character Movement Component to constrain the character to a plane (you specify the plane), and I think you can also modify gravity, combining those might get you what you need!