Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

32 x 32 sprite is getting garbled in game

Discussion in '2D' started by Splosions, Jun 15, 2019.

  1. Splosions

    Splosions

    Joined:
    Apr 29, 2017
    Posts:
    30
    I use 32 x 32 sprites and when I am in game they are all crushed and compressed.
    If I maximize the play screen they start to look ok. Not always perfect though.
    My sprite sheet
    1.PNG

    In game it looks like this

    2.PNG

    The grid layout is setup like

    3.PNG

    The image setup

    4.PNG

    If I click, set native size I get this

    5.PNG

    Also the Canvas settings




    The sprite looks good again. If I set the scale on the grid layout object to 2+ the sprite looks good, but then it takes up the whole screen.

    I have tried setting the Pixels Per Unit of the sprite higher, but the result is the exact same.

    Why does this simple sprite get garbled so much?

    I have tried messing with mip maps, but I am not sure what I am doing so nothing really changed.
     
    Last edited: Jun 15, 2019
  2. DavidNLN

    DavidNLN

    Joined:
    Sep 27, 2018
    Posts:
    90
    Hya, first of all it would be helpful if you gave us that sprite, or better yet a minimal project that reproduces the issue so we can try and see for ourselves.

    Secondly, I'm not sure, but it looks like your sprite doesn't have enough room, so it squishes down, so make sure it has that space.
    I also noticed that you are using scale with screen size, but your reference resolution seems a bit low, unless that easy really the size of the screen your'e testing this on.
    Also, maybe set the reference pixels per unit (Of the canvas scaler)to 32, so it will cover the same amount of pixels in the ui.
     
  3. Splosions

    Splosions

    Joined:
    Apr 29, 2017
    Posts:
    30
    I will work to get a cutdown project

    The sprite slot is set to 32x32 in the grid layout, so I don't understand why it would be getting squished in the first place.

    The canvas reference pixel setting only appears to alter how rounded the edges of the UI corners appear to be, setting it anything never changes the look of the sprite, only the sharpness of the UI menu corners

    Messing with the resolution actually made everything worse, all the text was fuzzy after that
    7.PNG
     
  4. Splosions

    Splosions

    Joined:
    Apr 29, 2017
    Posts:
    30
    I ended up finding a panel higher in the hierarchy that was scaled to 1.2 after setting it to 1, the sprite looks good again