Tiles are above the player after exported tiles to unity

(Rio Araki) #1

Hey, I am new to tiled and unity. Currently, I am following this tutorial to make my own top down 2d game. I have followed the steps mentioned in the video including import tileset, make collision box and use tiled2unity to export to Unity project.

However, my imported tiles are always above my characters. I have tried to change the sorting layer of them, but it didn’t work though I am sure my sorting layer is set to be right. In the video, it seems like the imported tiles are under the player by default which is not true in my case.

Any helps are appreciated

(Rio Araki) #2

LOL I found the answer through another post. It can be solved by changing player’s z-index. When I set player’s z-index to -1 (originally 0) and background to 0 everything works. Though I don’t know get why both stuff at the same z-index would always make player lower than background. Also is there a better way to solve this rather than change z-index in case we have a lot of different layers?

(Seanba) #3

Hi there. By z-index do your mean the z value of the player sprite’s position in their transform? You shouldn’t have to manage that unless you are using the depth buffer.

Do you have the “Use Depth Buffer” option enabled in Tiled2Unity when you do your export? Unless you are really sure you need it then it’s best to leave that disabled and use sorting layer name and sorting order properties instead.