- Home /
Player gets stuck on the edge of the collision.
It also sometimes happens when you are standing right next to a wall, only in this case player acts as if there's obstacle right overhead. It's like if the tiles have absolute friction.
The code that is responsible for the movement of the character object is from Unity's template platformer project, with a slight one line of code modification to discrete the resulting position for pixel snapping: https://pastebin.com/1HYszR08
Answer by Felipe669 · Dec 20, 2019 at 02:39 PM
Hey there!
This is why I like to use a CapsuleCollider2D for any character, with a PhysicsMaterial2D configured like this: This should keep the player from getting stuck like that.
Hope it helps!
I thought about using capsule, but won't that make platfor$$anonymous$$g harder because it will be rolling off the edges of platforms?
Your answer
![](https://koobas.hobune.stream/wayback/20220612220429im_/https://answers.unity.com/themes/thub/images/avi.jpg)