How to make a character attach itself to the wall and walk up it as if it were walking normally

Ok so basically im making a fps but adding dynamic gravity that changes based on the players orientation so basically if im on this wall my gravity is pulling me towards the wall not to the ground aswell as I can walk up on the ceiling with no issues and gravity would technically be pulling me up due to me being on the cceiling