Search Unity

Tile Palette off-center for any sprite assets not using center pivots

Discussion in '2D' started by AssembledVS, Oct 14, 2017.

  1. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    248
    If my actual sprites have a non-center pivot (for example, I use bottom pivots), the Tile Palette does not display my tiles correctly. They are offset from the grid. The tilemap anchor can be changed (0.5, 0, 0 for bottom pivots) and the actual tilemap tiles are displayed correctly. Here is an example of what I mean.

    I use bottom pivots because my game is a top-down Zelda-like and it makes sense for all of my objects (at least my game objects). When 2D sorting is re-implemented in the tilemap, I'm assuming that it will work around pivots so I'd like to keep using bottom pivots for now.
     
  2. Louqou

    Louqou

    Joined:
    Nov 19, 2017
    Posts:
    3
    Sorry to bring this back, but I'm currently suffering from the exact same issue. Did you ever find a solution?
     
    Aeroxima likes this.
  3. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    You can edit the Tile Anchor of the Tile Palette by:
    • Selecting the Tile Palette asset in the Project Window
    • Opening the Tile Palette in Prefab Mode
    • In Prefab Mode, select the Tilemap component of the Tile Palette
    • Make the appropriate changes
    • Save the Tile Palette instance changes
     
  4. asaf92

    asaf92

    Joined:
    Apr 5, 2019
    Posts:
    1
    I did the steps mentioned above, but it doesn't help.

    In the tile-palette the grid looks fine:
    upload_2020-10-10_15-26-7.png

    But in game when I try to add it, it adds it off-grid
    upload_2020-10-10_15-26-41.png
     
  5. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    @asaf92 You will need the same Grid settings as the Tile Palette for the Grid in the Scene. If that is not what you want, you can instead change the Pixels per Unit value for the Texture of the Sprite to ensure it fits well in the scene.
     
  6. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    I followed ChuanXin's steps to edit the Tile Anchor of my Tile Palette. (Step 1)

    Tile Palette Anchor.png

    Then I realised I had the same issue as yours. So I went on to change the Tile Anchor of my Tilemap (Step 2) as what ChuanXin suggested and it works. Does yours work now too?

    Tilemap Anchor.png

    P.S. I changed my Tile Anchor to (2,2) but I guess it varies based on different tilesets.
     
    Last edited: Nov 6, 2020
    javernaut likes this.
  7. emansmurf1

    emansmurf1

    Joined:
    Jan 9, 2021
    Posts:
    1
    Im not the OP but this worked for me!
     
    Xiangting_Su likes this.
  8. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Awesome! That's great to hear! Thanks for letting me know. :D
     
  9. Coronal556

    Coronal556

    Joined:
    Jan 14, 2021
    Posts:
    5
    Thank you so much! worked for me