Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Artifacts on pixel sprites after slicing in Sprite Editor

Discussion in '2D' started by gotnull, Jun 26, 2015.

  1. gotnull

    gotnull

    Joined:
    Jun 7, 2015
    Posts:
    7
    I am slicing a 300x270 spritesheet into 30x30 grid slices to produce sprites like the following:

    Screen Shot 2015-06-26 at 10.47.06 AM.png

    I'm noticing that in the Sprite Editor that it's not slicing them pixel perfect and it's including a little bit of an artifact on the bottom of the above sprite for example (his two feet):

    Screen Shot 2015-06-26 at 10.50.16 AM.png

    When I then include this in my scene I see the artifact like this in game (see above his head? that's his feet from the sprite above):

    Untitled.png
    I should mention the settings I'm using for the spritesheet before I slice them:

    Texture Type: Sprite (2D and UI)
    Sprite Mode: Multiple
    Pixels Per Unit: 16
    Generate Mip Maps: True
    Filter Mode: Point
    Max Size: 512 (my spritesheet is 300x270)
    Format: Truecolor

    Am I slicing these images correctly or is there something I'm doing wrong?
     
    Last edited: Jun 26, 2015
  2. Outwizard

    Outwizard

    Joined:
    Jun 25, 2015
    Posts:
    22
    Last edited: Jun 26, 2015
    TokiDokie and remixtoxa like this.
  3. gotnull

    gotnull

    Joined:
    Jun 7, 2015
    Posts:
    7
    I have so many spritesheets that moving them all to have 1 pixel between edges is ridiculously time consuming. Is that seriously the only way possible? Seems like a bug in Unity.

    I also mentioned all the settings I've used for my spritesheets and Filter Mode: Point was one of them.

    Thanks for your reply.
     
  4. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    You could try adding an offset value when grid slicing your sprite sheet in the Sprite Editor to ensure that your sprites are captured correctly in your sliced cells. You can verify that by zooming in in the Sprite Editor to see if the pixels belong to the right cells.

    Alternatively, you can make use of the Sprite Packer by adding a SpritePackingTag to your textures. This will add an edge padding to your packed sprites.
     
    theANMATOR2b and gotnull like this.
  5. ArtMaddox

    ArtMaddox

    Joined:
    Jul 27, 2016
    Posts:
    1
    I had this issue and fixed it by slightly raising the sprite's position on the y-axis. I think it was something to do with how I placed the sprite in the scene on the ground collider. Maybe they were overlapping and causing issues.
     
    Plasmajam likes this.