Rigidbody getting stuck on walls, when applying force to it

I made a character controlling script, using rigidbody and a box collider, everything seems to be fine, except, when I try to jump up a wall whilst applying force to the rigidbody (against the wall) , most of the times it get’s stuck and don’t fall until i stop applying force, anyone have any suggestions, it’s driving me crazy already.

http://answers.unity3d.com/questions/264016/rigidbody-stuck-on-wall-when-jumped-against.htmlhtml

Put a new physics material onnthe player or wall and set friction to 0 (you may also need to set its friction combined to minimum). Or you can use raycasts to detect if you are hitting a wall, and if so, stop adding force.

I forgot to put the Physics material on the material, thanks.

How would you implement the raycast option if you don’t mind me asking?

maybe something like this https://discussions.unity.com/t/481272/4

I tried to do that, but it still gets stuck on the walls.