- Home /
 
How can you prevent a 2d player object from snagging on tilemap collider corners?
I'm creating a 2d platformer and I'm running into an annoying issue where my player object will snag on the external corners of the tilemap environment. What I mean by snagging is that if the player is pressed against the wall and jumps upwards, they will be stopped at the corner as if there was a ceiling there when there clearly isn't. For my tilemap, I have a tilemap collider which is used by a composite collider with Polygon geometry generation. I've tried setting up my player with every type of collider I could, but only capsule and circle colliders don't snag completely, but are still slowed down and pushed considerably. Strangely enough, I've also noticed that this snagging doesn't occur if the corner doesn't have a line connected to it (not sure how to explain this), but this is what I mean:
Will snag: 
Won't snag: 
However, if I use outline geometry on the composite collider, all corners will snag. I'm assuming that it's a physics-system issue, but I'm really not sure what's going on here. Does anybody have advice/ways around this?
Answer by BenBartlett · Jul 11, 2020 at 08:43 PM
The problem was with my player movement. I had thrown together a super basic script that just changed the objects position, which caused it to snag. All I had to do was rework it with physical forces and the problem went away. Still not sure why it was happening in the first place, but it's all working now :)
Your answer
 
             Follow this Question
Related Questions
Destroy Tiles That Collide With Object 1 Answer
tilemap collision not working with sprite 2 Answers
How can I disable collision for 1 tile? 4 Answers
How can I find the name of the tile that I collided with in 2d? 1 Answer
How to the detect what side of the player is colliding with a object in a tilemap 2 Answers