In Unity5 why some sprites in spritesheets are not visible in sprites but works fine in UI images?

1.9k views Asked by At

In Unity5 I use texturepacker and made several spritesheets, but some images in several spritesheets don't work with sprites, whether I created them by dragging the image name under the spritesheet name in project inspector, or manually created an empty game object and adding a sprite renderer then choose a sprite which has problem for it, or even I drag another working sprite to create the game object, then change the sprite to the not working ones, the image in both Scene and Game windows just disappears.

enter image description here

However the not working ones can be uses on UI image component.

BTW if I bring up the "select sprite" window by clicking the little circle behind the sprite bar on a sprite component, all the not working images are not visible. You can see it on the following screenshot: enter image description here

1

There are 1 answers

6
Mostafa Berg On

First of all unity automatically packs sprites, don't do it yourself, here's what you can do:

  1. Remove the broken sprites from the project
  2. Remove all packed textures you created
  3. Add the sprites again as separate image files
  4. Select all the new sprites, then in the inspector set them to Sprite (2D/UI) and give them all the same packing tag, this will tell unity to pack them into one spritesheet together

another note: UI images will not appear if they're not a child of a canvas.

Unity Docs: Sprite packer

Sprite packing Tag