How to detect the angle off the collision with an array (or collider)?

In my scene (room) I want the character to be able to walk on all walls, therefore I created a bridge to connect them. If I know the collision of the player on the bridge I can rotate him and add gravity to him so that it looks as if he would normally walk on the ground. I’am not using a CharacterController and I’am using an array for ground detection so how can I detect the angle of the ground with it (or if not, with a capsule collider)?

Try getting the normal of the impact point and use the inverse of it as the gravitational direction