is your game window scale 1?
sometimes when i choose a resolution larger that what fit (default behaviour) it scales it down and see lines
but change to small res like 800x600 that filts easy with no scale and problem solved?
yes scale is 1. thankfully it only does it while developing. once deployed on my iphone i never see it.
also I messed around with things a bit more. it doesn’t seem to happen with tilemaps made using the built in tile palette. it’s only doing it on my maps i procedurally generated w/ Tilemap.SetTile()
Hello,
Assigning a packing tag to my tile-set and let unity pack my tiles solved my problem.
Best regards,
Hello,
I experienced the same/a similar problem.
Setting:
Camera.projection == orthograhic
Camera.Size = 8
Observations:
- SpriteAtlases did not help me.
- Disable Camera’s "Allow MSAA’ reduces the problem, but it is still very visible
- Every time the problem occurs, the camera’s position is (camera.position.x % 0.1f) == 0
- The problem does not occur on every one of these position (problem occurs on x = 5.5 and 5.3 but not on 5.4)
Solutions:
- Force an offset on problematic positions: Add 0.01f to position.x, when the upper mentioned condition is met. (Only add when condition is true, otherwise x = 5.49 → 5.5 → Bug)
- Change Size of Camera: When I change Camera.Size from 8 to 8.01, I dont experience any problems. If I set size to 7.01 I experience problems, but not on 7.
However, when I enable camera’s "Allow MSAA’ the game is screwed totally.
It seems I had same issue. I’ve solved it by disabling “allow HDR” on the camera
I’m on Unity 2017.4.17f1
Creating an atlas with padding of 8 seems to solve the issue for me. However, there’s a related issue where the background sometimes gets shown between tiles.
One thing that seems to solve that for me is setting a tile gap of -0.001 (1/10th of a pixel). This does make the grid size slightly smaller, so you might want to compensate this by scaling the transform (the amount depends on your grid size… should be gridSize / (gridSize -0.001)).
EDIT : the colliders don’t seem to be put in the correct spots when scaling the grid’s transform, so this solution might not be ideal.
So if anyone is reading this and wondering how to create the texture atlas, it pretty simple. If you have all of the sprites you want already setup that’s fine too. Simply create a Sprite Atlas from the create menu. Add all the sprites to the atlas. Build the game. It will create the atlas, and use it automatically. This fixed ALL tearing for me, and i only had to use 4px padding. You will see how it works if you notice that the padding is a stretching of the edge color. This will give the UV projection some wiggle room.
If anyone is still wondering, I had a similar issue and making sure that on the texture itself that:
Extrude Edges is 0
fixed it for me.
Good luck!
I was faced the same issue, I found a solution but quite boring…
I import my tile one by one why sprite mode single. Then they have to be already sliced.
I dont know why but when I do it in sprite mode multiple and I slice correctly my sprite, it adds this 1 pixel line on the right or left totaly random, because in the game some of the tile fit perfect, other leave a 1 pixel line empty.
At least when you import all of them one by one in your tile palette it works for me, very boring but when your tile palette is made it goes faster and works.
I think for me it cames from the slice of sprite editor but dont found why.
I search for 3 hours without other solution.
hope will help
After fighting with this issue for way too long, I just found a surprising solution that, as far as I can tell so far, completely eliminated the problem. I say it’s surprising because it’s partly kind of the opposite of what is suggested in this thread. So just posting this as a heads up
I’m using somewhat high-res Tiles, not pixel art, that are packed in a SpriteAtlas. MipMaps are enabled because I have dynamic zooming and whatnot, filter mode is biliniar because I need them to have a smoother look than with point filtering when zoomed out etc. I got these black lines, mostly vertically every time when my camera movement was smoothing/damping out (using CineMachine).
What almost completely eliminated the problem for me was turning on Anti-Aliasing in the project settings and the camera component. The issue is considerably less noticeable when using 2x and 4x Multi-Sampling, and pretty much gone at 8x Multi-Sampling (this can be set in under Quality in the project settings).
I imagine this is not a solution at all for anything pixel art, but for me higher res stuff, it seems to be the best solution I’ve found thus far.
Anybody still suffering from this issue can try using this free asset to process tile sheets and fix the gap.
My problem was fixed by changing the cell size in the Grid. (Also you can change the Cell Gap), not the best solution, but it is actually working.
I looked into this issue a lot, and I heard of people having alignment issues after using that technique.
The free plugin in the post above makes the solution quick and easy, and fixes the problem at source rather than hacking a fix in later.
As mentioned by the Johaness_Reuben , packing the tiles to a sprite atlas (in unity already) with padding fixes the root of the problem. You can pack sliced up tiles from a tileset-image. It might seem hacky as you already have a tileset image, but you need to slice it up and re-atlas it with edge padding.
I hope this helps any future readers.
Changing the Tiles Pixel Per Unit from 32 to 31.99 fixed the problem for me without other issues so far…
Is anyone else having issues? Workaround is setting the Cell Gap to -0.01 on the Grid itself. Depending on your tiles, you may get unwanted clipping, but worked for mine.
u’re the best ![]()
Use this tool I made - [Released] No more tileset tile tearing in game!!! Tileset Overflow tool!
It adds overflow to the edges of your tiles in your tile set and eliminates tearing.
If the textures give you a “Weird line” at the border Go to that texture and go to Advanced:
in Filter mode choose “Point (no filter)”