Sprite only showing middle pixels?

Hello everyone,

Veteran programmer, but very new to Unity, so be ready for a very ignorant question.

So I’m trying to add PNG files to a tilemap palette, but only the middle few pixels of the PNG are displaying. Even the PNG “preview” within Unity is only showing the middle few pixels. Here is a visual of what I am seeing:

3473206--275958--unityissue1.png

To the left is the full PNG. But the “preview” on the right is only showing the middle 9 or so pixels. Similarly, when I view each of these in the inspector, this is what I see:

For the PNG:

3473206--275959--unityissue2.PNG

And for the “preview” portion:

3473206--275960--unityissue3.PNG

And this preview portion is what is getting added to the asset file and the tilemap palette when I drag it to the palette area.

Let me know which tilemap, grid, or sprite settings are relevant to share (not knowing which were relevant, I didn’t want to spam them all).

Can anyone tell me what I’m doing wrong?

Thanks

Have you changed any settings in the Sprite Editor? Is it just imported with Sprite Mode set to Single?

Thanks for the reply. No, I had never opened the Sprite Editor until you mentioned it, so I didn’t change any settings in there. As for the Sprite Settings, I think they are all still the default for a new Sprite, including “Sprite Mode: Single”:

3477547--276467--unityissue4.PNG

Anything there seem amiss? Any other settings I should look at?

In case it matters, this is happening to all Sprites I create.

OK, I figured out what is happening, though I still don’t know why.

The issue is that if I use the “Assets” > “Create” > “Sprite” > “Square” menu, the default size of the sprite canvas is 4 pixels by 4 pixels. What I had been doing is using the “Image” > “Resize” and/or “Image” > “Canvas Size” options in the sprite painting tool to change the size to 24 pixels by 24 pixels. While the paint tool let me do this, apparently the original 4 x 4 canvas size was still being stored somewhere, as that is where the smaller middle section was coming from.

I discovered this by launching the sprite paint tool and just choosing the “New” button and specifying a canvas size of 24 x 24 to begin with. Doing that, the size of the sprite image was fine.

I’m not sure why resizing the canvas or changing the canvas size doesn’t change whatever meta data is used to display the sprite. That seems odd, especially since the sprite starts off so small (4x4). But at least I know how to work around it for now.