How to stop 2D tile based colliders from activating incorrectly

Hey there. I’ve been experimenting with a few things and I’m trying to work through a specific problem:

I have a bunch of tile objects each with their own collider that make up the floor of an area. The “Player” object also has a custom polygon collider and can move left and right. Sometimes the player get’s randomly stuck moving left and right on these tiles. When I get stuck, if I switch directions and then quickly switch back it lets me move as if there was nothing there to stop me in the first place. It’s very odd. I’m looking closely at the collisions (With the debug gizmos active) and I can’t see why it’s getting stuck.

Here’s an example of what’s happening:

Here I’m trying to move Right, but the player collider is stuck on the tile collider with a force pushing left. If I decide to go left and then right again, I can now suddenly move past the point I was stuck to begin with.

I have a feeling it has something to do with the odd shaped collider the player has, but there must be a way to get this to work

Thanks!

That´s a common problem with “tile based colliders” as you call it. The edge of your players collider simply overlaps with an edge of the ground collider. A solution for such an issue is mostly to use a round collider for the bottom of a player character or to only have one long collider for the ground.

The former is usually the easier one. Something like this might help you:

There is nothing wrong with having multiple colliders on an object. As far as i know. To make this work you also have to slightly lift the bottom edges of the other collider so that it does not touch the ground with its edges anymore. Only the round shape should touch your tiled colliders (:
Hope this helps.