Seanba / Tiled2Unity

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

Imported map hide other objects? #164

Closed Mecanne closed 6 years ago

Mecanne commented 6 years ago

Hi, When I import a map into Unity, and then into the Scen View, my player gameObject hides behind the imported map. I tried to change Z-Axis of both but I can't solve this problem. I'm a beginner with this and I do not rule out that it's a problem of mine, but I wanted to know if someone else has happened the same. When I import the map, I have't got any error or warning, all seems to be right. Here I let you some images and gifs of the problem.

https://i.gyazo.com/aad92821e781f98cd6a287dc3ab61e48.mp4 Player properties: https://i.gyazo.com/4d55f7d570cd6fecf47b3b05b54250f9.png https://i.gyazo.com/fb1cf132f668e8bab76a35312a32891e.png Map prefab properties: https://i.gyazo.com/7237c232c0663703f8e8d935725f2bb2.png

I hope you can give me a solution, Thanks.

PD: Sorry for my bad english :)

seanb-22ct commented 6 years ago

Hi Mecanne, it's probably the sorting layer or order in layer settings on your sprite or on the map itself. I see that you are using a sorting layer Unit and with order 1 for your sprite, but what about your map?

Mecanne commented 6 years ago

Hi seanb-22ct, thanks for answer! Here I give you all the info about the map I used. I also leave the whole project in case you want to keep an eye on it, along with all the generated files together with tiled2unity. One more thing, when I select the object of the map, I get this orange line, I do not know if I it means anything.

Map properties: https://gyazo.com/04e44777937b4b150cf0e6b49a0d7adb https://gyazo.com/3f1239071404af08ce4243a14a4218a7 Project: https://mega.nz/#!kxFgEbIJ!5iFkY1fQBw7RBErtBd-GDxFbffYXOqBeEXO-KEdNMTU

Thanks.

Seanba commented 6 years ago

Hi again. I see two problems here.

First, you'll want to manage your Tags & Layers in Unity so that Unit is displayed on top of Floor (and Default - which your imported map is using.)

image

And second, you are using the "depth" shaders which is something I never really got working correctly. The new version of Tiled2Unity I'm working on will improve on this but in the meantime make sure you have depth shaders turned off.

image

Hope that helps.

Mecanne commented 6 years ago

Perfect, it was that. Thank you very much for helping me. I'm new with Unity, I thought the layers went from top to bottom, and not the other way. I had not realized the depth option was checked, my mistake. Again, thank you very much!

Seanba commented 6 years ago

I'm glad to hear it. Good luck with your game.