Layers on Top/Below Player

In general, you can place the tree in a special layer (either manually in Tiled or by recognizing the tile in your game, for example using a custom tile property), and render the tiles in that layer along with the moving entities in your game, after sorting them by Y coordinate.

With Tiled2Unity you can probably avoid adding the tree to the mesh, and add it as a game object instead (it may support custom layer properties for this). But using a depth buffer is also possible, if your tile graphics aren’t partially transparent. And depending on the amount of trees this may be more efficient.

2 Likes