- 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
Stuck Between tilemap colliders 0 Answers
When my character walks left and right on a tile map, the value of rb.velocity.y is often not zero. 0 Answers
Composite Collider on Tilemap not really stopping player 0 Answers
How do I know if collision is from right or left when using a Tilemap Collider 2D 0 Answers
2D Tilemaps: how to set colliders on scriptable tiles derived from Tilebase class 1 Answer