2D Toolkit Forum

2D Toolkit => Support => Topic started by: couger on January 01, 2014, 04:01:32 pm

Title: Tilemap and sprite draw order problem
Post by: couger 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
Title: Re: Tilemap and sprite draw order problem
Post by: unikronsoftware 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.