Hello Guest

Author Topic: Tilemap and sprite draw order problem  (Read 3818 times)

couger

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Tilemap and sprite draw order problem
« on: January 01, 2014, 04:01:32 pm »
Hi,

I'm having some issues with the draw order of sprites and a tile map. I have 3 layers on my tile map, what I want is the player to sit on layer 2, between layer 1 and 3 so my main character appears to walk behind some of the tiles. I have created 3 layers all with different z values and the tile map appears correctly. My problem is the player is either behind all the tiles or in front of all the tiles, doesn't matter what layer or z value the player is on this never changes. I cant find any combination where the player sits between tile layers.

Is the above even possible, if so how do I do this

Thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap and sprite draw order problem
« Reply #1 on: January 01, 2014, 11:59:56 pm »
Are you using a perspective camera, etc? If the z separation is sufficient between layers, and the sprite is sandwiched between the layers, it should sort correctly.

You can of course ensure sorting order using the unity 4.3 sorting layer system. You set up the layers for your tile maps explicitly, and you do the same with your sprites.