Search Unity

Question Isometric tiles with different sizes

Discussion in '2D' started by lukaszpatula, Jun 21, 2021.

  1. lukaszpatula

    lukaszpatula

    Joined:
    Jan 8, 2020
    Posts:
    9
    Hello. I have a grid with isometric tiles. But some tiles are wider from the left side and should be put more to left and down. I'm not sure how to do it. Can someone directs me how to do it? I have attached screen with problematic tile selected.

     
  2. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Hi, you will need to adjust the Pivot of the Sprite used in your isometric Tile using the Sprite Editor. The pivot should be aligned based on the terrain portion of your Sprites rather than the full art.
     
    lukaszpatula likes this.
  3. lukaszpatula

    lukaszpatula

    Joined:
    Jan 8, 2020
    Posts:
    9
    It helped, thank you :)
     
  4. lukaszpatula

    lukaszpatula

    Joined:
    Jan 8, 2020
    Posts:
    9
    One more question in the subject: I have a tile 120x160 pix, and when I set them together, I get unexpected shift of the most right tile on this screenshot:



    As you can see, it happens only in case of these tall tiles with grass. Why does it happen?
     
  5. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,514
    It overlaps like that because the sprite is larger than the grid square. You can fix it by adjusting the Pixels Per Unit if you click on the sprite's texture in your Project. Also, it looks like the pivot needs adjustment as well.
     
    lukaszpatula likes this.
  6. lukaszpatula

    lukaszpatula

    Joined:
    Jan 8, 2020
    Posts:
    9
    Thanks, Lo-renzo! Now it works like a charm :)