Grid Cell Size 0.2 messes up composite colliders

I’ve been working with 20x20 pixel tiles that I’ve been importing as sprites at 100PPU. I wanted to try using these with the Tilemap, but it seems the Tilemap is expecting my tiles to be 100x100 in order to properly fit them to the grid. I tried setting the Grid’s Cell Size to 0.2, which did fix the problem, so now the tiles fit perfectly in the grid boxes, however, this introduced some strangeness with composite collider 2d.

Every few tiles, it creates a new collider instead of just adding to the existing composite collider. I know the Grid’s Cell Size is the issue because if I import the same tileset sprites at 20PPU and use it on a Tilemap with a Grid Cell Size of 1 (the default) then it doesn’t have this problem.

Here’s some pictures to illustrate this:

Palette generated from 100PPU sprites, Cell Size: 0.2. More colliders created than expected:

Palette generated from 20PPU sprites, Cell Size: 1. Correct number of colliders created:

Think it might be a float issue or perhaps an import scale issue?

Same problem here

Not properly the same, My composite collider doesn’t work when grid size is bigger > than 0.25

@Pilessio Would it be possible to file a bug report using the Unity Bug Reporter with your project and post the issue number here? Thanks!

Hi ChuanXin
Resolved here increasing property “Extrusion factor” “TilemapCollider2D”.

I had to delete every tile I painted in tilemap, increase this value from 1e-05 to 1e-03 and repaint my tiles. Now composite collider will work.

There was an issue related to this which would be fixed in 2019.1.11 ( Tilemap and colliders ). If you do experience this issue again, perhaps you could try out that release when it is available?