I havent tried this either, but you could use a linetrace downwards to calculate the normal of the floor. Based on the normal, increase / decrease gravity to force the character to stay on the ground.
I had to do something similar on a sliding mechanic I worked on for my first game. Basically my character would fly off the slope at high speeds. My solution? Applied a constant downward force why sliding to “stick” the character to the floor.
Hope this helps!