How to detect angles of walls?

I want to detect angles for some important features in my game. First, I want to develop a custom 3D character controller, but How can I make it so that, if I walk into a wall at 45 degrees for example, I move while rubbing on the wall but 2X slower? and the more I face the wall, the slower I go? And after 45 degrees or so, I can’t move at all? Also, It would be helpful for custom physics. I want to make my own physics system that takes in physics material values and uses them in code. But, I don’t know the formulas for how an object bounces off another. Can I do this with raycast? I just want to know what I can do to make this before I start creating my controller.

You can do this with Raycast. The hit.normal on a simple object like a wall (without a normal map) should be all you need; see