Having issues using a spritesheet for images / animations in Unity... help!

Hey! I’m trying to import a spritesheet my artist made into Unity and then chop it up and use the images to create animations. It’s mostly working, yet I’m having this weird issue with some pieces and I think I must be doing something wrong.

So, step one is that I import the image into Unity and set the “Sprite Mode” to “multiple”, as such…

I then go into the Sprite Editor, choose to “Slice”, set it to “Grid” and set it to 64x64, the size of my sprites. Leaving everything else at its default, most stuff looks ok, but a few pieces have some rogue pixels appearing on the side. For instance, I go to check my three pieces for my “float” animation and the first two have some pixels hanging on the left side. As far as I can tell it’s basically taking a tiny chunk from the right side of the sprite and adding it to the left side for some reason.

I double checked the spritesheet I got from my artist and everything is legit, fits nicely into the 64x64 boxes. So it’s not the fault of the original image. Anyway, if I change “Max Size” from 1024 to 4096 the rogue pixels disappear (not to mention the images look much cleaner… yet still kind of janky?)

So, problem solved right? Nope. I create new animations using these pieces and the “float” animation still has the issue despite the images looking clean when viewed alone.

I have no idea why.

What am I doing wrong?! It seems like it should be easy enough to just take a spritesheet and make animations from it but I’m clearly doing something wrong here…

PS. This is all just for the PC build.

Disable Generate Mip Maps can solve this hopefully

If your sprites are taking up a 64x64 area for the actual images then put them inside 66x66 rectangles on the sprite sheet and slice at 66x66. I used to get this same behavior constantly and it drove me a bit batty.

1 Like

Disabling the generate mip maps didn’t fix it. Is making 66x66 pieces really the only solution here?! Seems like that could cause even more problems in the future.

The only consistent way I have found is to have a padding of transparent pixels around the image. If I use rectangles of 64x64 then I make sure the actual images are no bigger than 60x60. The two pixels on each edge might not be needed. Maybe one would work but I got tired of screwing around with it and just used 2 (or more) pixels on each side and had no more issues.

EDIT: Oops I originally wrote 62x62 and I meant 60x60 so fixed that. Watching WWE PPV atm so my mind was only half here. lol :wink:

1 Like