- Home /
Question by
gazer500 · Apr 10, 2020 at 12:50 PM ·
c#movement2d-physics
How to prevent sliding when walking up slopes in 2D?
If my player stands still on a sloped object, the character slowly slides down. Not only that, but if I go up or down a slope, I get launched up or down respectively. I tried to set my gravity to 0 when not moving to fix this, but that only fixes the first problem. I have no idea how I should solve this, so any help would be greatly appreciated.
Comment
Answer by krispastas · Apr 10, 2020 at 01:07 PM
Try to create a Physics 2D Material, apply it to your slope sprite and increase the friction to a very high number. Hope this helps.
I have just tried this, but even when adding the high-friction material, nothing happens.
Your answer
![](https://koobas.hobune.stream/wayback/20220612231015im_/https://answers.unity.com/themes/thub/images/avi.jpg)