0
votes

I making a 2d game and I am having some very random problems... My sprites are not displaying as they should be. Below is a screen shot of what I see when I run my game. This bug is present in the game window and the scene window, both when the game is running and not running. And the glitch is not because of the tiles being offset (The background is made up of tiles), if you look closely the player sprite is also glitched up. I have tried restarting unity and my computer, one of which has worked. I have been having this problem ever since i started using tilesets (using one PNG image and cropping out smaller sprites by setting the sprite mode to multiple, instad of using just one PNG image where there is only one sprite and the sprite mode is singular). How do I fix this? (BTW I am using Oryx's lo-fi fantasy and sci-fi sprites at www.oryxdesignlab.com)

enter image description here

2
That looks like your texture UVs aren't quite right. At a glance, it looks like you're catching just a tiny sliver of the adjacent sprite on the sheet. This can happen if your sprite sheet doesn't include any space between sprites.rutter

2 Answers

1
votes

This happend when your atlas is not sliced correctly. When you making 2D game there are several important things about sprites.

  1. Set Filter Mode to Point
  2. Set Fromat to 16 bit or TrueColor (in special cases)
  3. Make sure that your atlas is sliced properly.

Edit:

  1. Adjust "Max Size" - make sure is value represents number equal or bigger than spritesheet size

The best way in sliceing atlas in Sprite Editor is NOT to use automatic. I got glithes like that in my project too and those steps can eliminate them.

0
votes

Have a look at your Sprite in the Sprite Editor. I think you can get to it by double clicking.

Your sprites will have sort of boxes around them to identify each individual sprite (if you set your texture to multiple). One of these boxes will not have sliced correctly, and will have overlapped into another sprite, hence why you're seeing what looks like the arm of another sprite in your picture :)