I’m having issues with my 2d tilemap. When the camera moves, I see gaps or tears on the tilemap.
I have found a couple of solutions that work some of the time:
One is to set a negative cell gap on the tile grid.
The other is to make use of another sprite material with pixel snap checked.
With the negative cell gap, I still occasionally see issues when the camera moves.
Pixel snap is inconsistent, it seems to work perfectly for awhile, then the problem returns.
Does anyone know why this is happening? And if there is a better solution to the problem?
this is happening because of scaling issues, you will experience them pretty much all the time. i use a canvasscaler object to rescale my tiles and its generally good. either way you’ll need to have something that will produce a consistent size for your tiles (either that or your actual images might have these little lines in there, such as from antialiasing/blurring, or you’re cutting too deep into the other tile (instead of cutting 0->49 you cut 0->50).
negative cell gap will hide/mask the problem but a proper solution (if you’re able to find it) will eliminate it altogether. note that negative cell gap will cause stretching/blurring issues.
This reply is super late, but I found an easy fix to this issue. In the grid, simply change the gap between tiles to something like -0.01. This way, they’re slightly overlapping, so there’s no gap to be spoken of. It could mess up tile-based games once you get further away from the origin, but for most of my situations this has worked.