I’m at my wit’s end with this one. I’m using MatterJS so I can have more complex tile collision shapes and sloped platforms, and I keep running into an issue where my sprite clips into my tilemaps. I’m working on a path follower feature to climb ledges, and that’s mostly where it happens. It could be that the path is making the sprite cut across the tile layer and the path coordinates need to be adjusted, but since the tiles are set to collide, wouldn’t the sprite just hit the tile layer and not be able to move any further?
Examples of the sprite clipping when following a path:
In these cases, the sprite jumps up onto the platform at the end of the path, and then falls down into the tilemap layer and gets stuck as shown. So, the sprite does clear the top of the platform and stand on top of it at first, but then it falls into the tile layer. When approaching these platforms from the other direction, there’s no problem, the sprite can stand on the platforms as expected. It’s just when following the path. I’ve tried adjusting the path coordinates and it still happens.
But it has also happened under other circumstances elsewhere on the map. For instance, sometimes the sprite has clipped through a bridge on the map: under those circumstances,the sprite will jump vertically up and then fall through the bridge. It’s happened a few other times as well at other points on the map.
I’ve been Googling for answers with no luck. Is there a problem with my Matter physics setup, or is this a Matter bug? Is there anything I can do to fix this?
You can view the source code in this Drive folder here.