Seanba / Tiled2Unity

Export Tiled Map Editor (TMX) files into Unity
Other
495 stars 120 forks source link

SpriteDepthInMap not working at all #162

Open phil123456 opened 6 years ago

phil123456 commented 6 years ago

Hello,

I keep changing my sprite "sorting order", "order in layer", and "interact with layer" options

the sprite is always above or always under the layer above the ground

z sorting does not work

my tilemap appear to be sliced and changing "tileset height" also seems to change the map slicing

as I go up or down, my sprite z value changes accrdingly but it's like all horizontal slices of map are on the same z value

any advice/tutorial ?

[edit : been checking the depth shader, it does not even seem to do anything additional concerning z sorting ...is this feature still supported ?]

thanks

phil123456 commented 6 years ago

anyone ? please ?

Seanba commented 6 years ago

Hi Phil. I've never really got depth sorting with Tiled2Unity to work in an acceptable way. Right now, if I was stuck with Tiled2Unity I would use Object Layers (and Tile objects) instead of Tile Layers. Then, I would craft a custom importer that would assign a "sorting order" to each tile in a way that made sense (probably making it a function of the y-position). Then, as my player sprite moves around the map I would set its sorting order based on y-position and I would get the behavior I wanted.

Granted, that does take some work. My apologies.

FWIW, I'm working on a new Tiled exporter that will use the new Unity Tilemap features. Getting proper sorting, especially for isometric maps, is one of the goals as well. That's at least a couple weeks, however, and depends on some fixes from Unity that I've reported along the way.

phil123456 commented 6 years ago

object layers in Tiled? but then I wont get the nice functionalities of a tile map and stuff and I would have to write an importer in unity that creates tiles manualy, I wonder about performances then how about using only one layer in unity and then modifying the "order in layer" in real time ?

I wrote a c++ SDL prgram that does import your tiled json format, maybe I could give it a try in unity, using "Order In Layer" dynamicaly

phil123456 commented 6 years ago

for info, this guy managed it to make it work but doing the same setup I cant achieve the same result https://gamedev.stackexchange.com/questions/154714/tiled2unity-depth-sorting-issue-with-multiple-layers/155297#155297