- Home /
Small line appearing under my 2D pixel sprite - 2D Graphics not rendering properly
I am relatively new to unity and i couldn't find an answer to this. OK, so this is the problem. I had imported a sprite into the scene and i attached a movement script to it and tried to move around. For some reason, there was a grey "box" or line underneath my sprite. I moved around even more, and noticed that even other pixels of my character were changing, like the hair or the shoes. It only appears every time i walked up and down. I checked my graphics settings and they are the same as the one i usually use for pixel-art (FORMAT = RGBA 32bit / FILTERMODE = Point / MAX SIZE = 2048). In the Inspector nothing is wrong, and all of the sprites look good.
This bug only happened to things that were moving relative to the camera on the y axis. So, for example if i had a "camera-follow" script attached to the player, it wouldn't happen to the player, but to everything around him when he moves up and down. This happened with every sprite i tried to render. I also tried to scale the original sprite up to 64x64 px instead of 8x8 px,but that just made the grey box bigger. It appeared in both scene and playmode.
Please help i am lost. :P
Just a quick guess : it sounds like an anti-alias problem (but it can be something else ^^). $$anonymous$$aybe you could try to render Franck at the original size (8x8) and disable the anti-alias in your scene and scene what happend.
$$anonymous$$ay it be from the wrap mode? $$anonymous$$aybe you should set it to Clamp in the import settings
Answer by tanoshimi · Apr 28, 2017 at 08:32 AM
A screenshot of your texture import settings would help, but I'd recommend you try the following settings:
Texture Type: Sprite
sRGB: Checked
Alpha Source: Input Texture Alpha
Alpha is Transparency: Checked
Generate Mip Maps: Unchecked
Wrap Mode: Clamp
Compression: None
Max Size 32 (there's no point having 2048 - your sprite is only 8x8)
It still doesnt work. I think i figured something out though. Its not just a grey box, but its the hair of the sprite beneath it in the spritesheet. $$anonymous$$aybe changing that will help. Thank you for your answer though, i didnt know that the unity community was so helpful :D.