What's causing my 2D platformer collision to fail on diagonal walls?
#1
I’ve been trying to implement a basic ** for my 2D platformer, but my character keeps getting stuck on tile edges when moving diagonally against a wall. I’m not sure if the issue is in my collision resolution step or if I need to handle slope cases separately from my core tilemap check.
Reply
#2
I’ve run into that same edge snag. My fix was to split the resolution by axis—handle x first, then y—so moving along a wall doesn’t push you into the corner. It made diagonal slides feel a lot less snaggy, even though it wasn’t a perfect solve.
Reply
#3
On slopes I kept tripping over small penetrations too. I suspect the real issue isn’t the tile map check so much as how a tiny slope check can override a clean axis push. We kept the core tile check simple but added a separate slope guard that only kicks in when the height difference is meaningful.
Reply
#4
I tried simplifying the world: we had a tiny gap in the collision mask between some tiles, and when you go diagonal you slip into that gap. We added a tiny buffer and a one pixel hysteresis near corners. It helped but only sometimes, depending on the tile variant.
Reply
#5
Have you tested if the problem follows a pattern across all walls or only on some tiles?
Reply


[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Forum Jump: