Unity Sprite Editor is treating Left and Right blocks as one

I have followed the lesson up to importing the sprite sheet with 0 hits, left and right blocks. When I try the automatic slice it is separating the top image correctly, however it is treating the Left and Right images as just another single sprite. Here is my brick image:

bricks

I am fairly sure I have removed all pixels between left and right and left it transparent. Is anyone able to provide me a pointer to what I may have missed?

Hi Stuart,

You could take a screenshot of the Sprite Editor window whilst you have this image selected for slicing please.

Thanks :slight_smile:

Of course, I should have done so right away :slight_smile:

(I haven’t yet adjusted the pivot point as I just quickly re-opened it)

1 Like

I’ve just had a look at your image.

The difference between the one Ben shows in the lecture and your own, is that all of your layers have been flattened within the PNG. You’ll note that Ben moves around the two halves and places them side by side before saving the entire image as a PNG, which retains the layering as well as the transparency.

I have just recreated your PNG file, and given the three bricks their individual layers. I’m using Macromedia Fireworks, the blue lines show the separate images within the file.

Try it now with this one;

StuartsBricks

Be sure to Right-click, Save As… to get the image as a PNG, alternative, download from here.

1 Like

Thanks, I will download it and try it. I hadn’t realised that PNG retains the layers. I manually flattened it because I thought the export would do the same. Thanks for your help, I feel a twit now!

1 Like

I would need to spend a bit of time playing around with it to see how necessary this really is, but in order to use the automatic option for slicing this really does seem to lend itself very well.

No need to feel a twit, it’s been so long since I sliced a spritesheet my first response to you was to change the width from 128 pixels to 64… needless to say - that didn’t really work either :wink:

I spent a little time testing an asset I had laying around, and your image file, and then recreated a new one after I noticed the layers. That seemed to resolve it the easiest/quickest way. It was a good practice/reminder for me, and will serve the community well as often these same questions pop up again, I’d not considered the layers before when I had seen similar posts, normally the transparency is missing between the images. :slight_smile:


Updated Mon Sep 11 2017 13:30

You can of course manually draw the boundaries around the image items also, so you could use automatic to get as many as possible and then simply draw the boundaries of your own in the sprite editor before clicking slice.

Left-click, hold, drag - green lines will display the boundaries of each box that you draw.

2 Likes

To my knowledge, PNG does not inherently support layers. The only program I am aware of, that make use of the chunk-based storage structure of PNG to support layers, is indeed Fireworks.
Other programs usually don’t know about these private chunks.
Does Unity really support that?

1 Like

Well I guess I have learnt something new today, I have only really ever used Fireworks, never got into Photoshop and have only ever used Gimp briefly, didn’t realize that about PNG, just assumed because Fireworks did it, all PNG did.

Unity worked like a charm with the images in the separate layers, indeed it was the key to resolving the original issue in this topic.

Of course, as mentioned above you can also manually drag/draw the sprite boundaries rather than using the, automatic option. There was nothing else that was changed. :slight_smile:

Thanks for the PNG info. Appreciated.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms