Saving the ability to move when the player flips

I have the following task that I do not know how to solve. The gravity in the world is 0. When I press a certain button, I turn my character upside down and direct the force vector up, equal to gravity. My character stands on the ceiling and can walk there, but he is always in a free fall position. If I disable the free fall position, then after the character stops on the ceiling, it will stop moving completely (I will not be able to control the “wasd” keys to move). How do I make it so that I can walk a character on the ceiling with normal animation?