Search Unity

Tile Palette gap in tile

Discussion in 'Editor & General Support' started by VaporAnomaly, Jul 21, 2020.

  1. VaporAnomaly

    VaporAnomaly

    Joined:
    Jun 9, 2015
    Posts:
    22
    Hi,
    I have created a tileset in Gimp and imported into Unity.
    I set the tileset sprite mode to 'Multiple' and opened the tileset in Sprite Editor.
    I used the 'Automatic' option to slice the tiles. It worked perfectly.

    The height is exactly detected to be 7 pixels, just like i drew it in Gimp. So, there are no invisible pixels.

    ConcreteBottom_SpriteEditor.PNG

    ConcreteTop_SpriteEditor.PNG

    But once i import these into Tile Palette, gap starts appearing above and below.

    Gap_TilePalatte.PNG

    And this gap, also shows up in the game and in unity editor.

    Gap_InEditor.PNG

    Can anyone please help.
    Do let me know if more information is needed.

    Each full tile in the tileset is 16x16 pixels HxW.
    The ones from the above screenshots are partial tiles 7x16 HxW.
    In Sprite editor, I have set the Anchors manually as i want them to be (Also captured in the above screenshots)
    In Unity Editor, on the Grid settings, I have set the cell size as 0.16x0.16 as it seems to be the tile size as per unity. Setting it to higher values cause the tiles to appear in center of each cell. Setting it to lower values cause the tiles to overlap. (Setting it to 0.15x0.15 causes the same issue as 0.16x0.16. Only difference is the gap disappears and what seems to be a seam starts appearing between tiles)

    Thanks
    Joshua.
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,909
    Shouldn't the partial tiles be 8x16? Doesn't 7 + 7 leave a 2 pixel gap? Or am I missing something?
     
    VaporAnomaly likes this.
  3. VaporAnomaly

    VaporAnomaly

    Joined:
    Jun 9, 2015
    Posts:
    22
    Hi
    Thank you :)
    You were spot on :)
    Having tiles with height 7 caused some cell sizes to be 0.4375 (As it does not clearly divide 16)
    Then the floating point imprecision too over and messed up the alignment.
    Thank you very much :D

    How do i mark this as answered!?