- Home /
Unity2D strange green line under sprites
So I have a randomly generated world with Sprites for tiles and when the Player is sitting on top of a tile, it makes every tile on the layer underneath him have this strange green like like this :
I have absolutely no idea what is causing it, does anyone have any ideas? I've tried changing the rendering techniques, the sprite's material with "Pixel Snap" on, still doesn't work. The sprites are all in a sprite sheet with Point filter mode and generate Mip Maps on, if that makes any difference.
UPDATE: I tried it on a different sprite that wasn't the dirt and I found that ins$$anonymous$$d of the line being green, it was blue like the background. It seems that the color of the line is the color of the top of the sprite underneath it on the sprite sheet??? Right under the Sprite for dirt, there is a grass sprite, which is why it's green I guess, and when I used a sprite with nothing underneath it, it just made it the color of background because of the alpha. Is this a bug, or am I doing something wrong?
I'm not sure what's happening as I generally work in 3D, but my first guess would be to try clamping your texture (make sure it's not set to "repeat"), since it sounds like you are not splatting the texture repeatedly on one object, but spawning separate objects.
$$anonymous$$y next suggestion is to open the sprite editor and make sure that the sprites borders are properly aligned
Thanks for the reply, The only place that I see Clamp is when I set the texture type to advanced, and it is clamped, so the problem is still there. And I used the grid slicing for the sprite sheet, and they are all 16x16, so they should be perfectly aligned, I also tried doing it manually, nothing changed. So strange..
Sorry to hear :( $$anonymous$$aybe check out some of the answers here as well http://answers.unity3d.com/questions/609736/gaps-sometimes-appearing-between-2d-sprites.html?page=1&pageSize=5&sort=votes
Thanks for that link, I added a "bleed zone" like one of the suggestions said and that worked, that's a really stupid way to have to fix this in my opinion. But thank you again for the link.
Your answer
Follow this Question
Related Questions
RenderTexture.Create failed: format unsupported 0 Answers
U5 shader coming out solid black on newer iOS devices (iPad 2 Air / iPhone 6) 1 Answer
RenderTexture and Readpixels android problem. 2 Answers
WTH does this error mean ? and what exactly is 'false' ? 3 Answers
Problem importing "survival shooter" 0 Answers