Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Correct depth position of Isometric 2D sprites with different side lenghts

Discussion in '2D' started by knappz0r, Feb 15, 2017.

  1. knappz0r

    knappz0r

    Joined:
    Jan 31, 2017
    Posts:
    3
    Hi all!

    I'm trying to make an Isometric city-builder (like Caesar 3 or Lethis) but I do not know how to properly make the graphics to work.

    When I have sprites where the sides, the length and the width, are not equal I do not know hot to calculate/fix so that the whole sprites have the correct depth-position. So that the sprite is in front of or behind other sprites correctly for the whole sprite.

    What I do now is that i calculate a mean depth-value for sprites (changing the Order in Layer), which works well for sprites with sides of equal length.

    What options do I have? Would changing the order of the tiles help? Must I split the sprites and if so how do I do that properly?

    Image below is from my game. Green circles show correct behavior, red circles show wrong behavior.



    Thanks in advance!
    //Knapp
     
  2. jackhearts

    jackhearts

    Joined:
    Apr 5, 2013
    Posts:
    103
    It's normally a case of organising your 'sorting layer' and 'order in layer' based on the tiles grid position. Then maybe make some tweaks to specific sprites manually if needed. That's about the extent of my experience with 2D tilemaps. Search for something like iso tile map rendering techniques. Plenty of good information out there.
     
    theANMATOR2b likes this.