Hi there, I keep getting a small gap/line inbetween my tiles in my tilemap and though I’ve found many intended solutions online for this, none of the ones I tried worked for me.
Here is the issue:
Here are the things I have tried:
Project Settings > Rendering > Anti Aliasing is turned off
Tilemap Grid Cell Gap was tried at both 0 and 0.0001 on X and Y, made no difference
Made a new material in the Sprites/Default Shader, with Pixel Snap turned on and put it in my tilemap sprite renderers. This almost worked, but I was still getting some lines as shown here:
So yeah, I’m not really sure what to try at this point. I saw that some people suggest making your sprites one unit bigger on each side but that’s a lot more work than these fixes were so I wanted to see if anyone had any other ideas before I do that. Thanks!
the thing you dont want to do is called padding, but you need to do it.
This is needed because you are using a 3d engine(unity) to render 2d graphics and this will never line up your tiles perfectly unless you create the absolute perfect conditions for it, which is much more troublesome than just adding 1 extra edge of pixels to your sprites.
You can use sprite atlas to add padding automatically.
Thanks a lot for the reply! I looked up Sprite Atlas and added one into my project but I’m unfamiliar with this. Is there some direction somewhere as to, or do you know, how to add the padding so I don’t have to do it manually?
I added the tileset file that I’m using for my tilemap to the objects for padding (added the entire sheet, rather than each individual sprite) but nothing seems to have changed and I can’t find any info on what other settings I might need to change.
no problem, you right click on your assets folder and create a new atlas asset, then click on the asset and use the inspector to assign settings, there will be a padding setting, set it to 2, then there will be a parameter to select which assets are packed, you can drag your sprites there. After that you dont have to do anything else and you can use your sprites as normal.
Do add the sprites and not the tilesheet, and you can click pack preview to check how the atlas looks ( it should look buggy if it has padding and not like a clean tilesheet)