Seanba / Tiled2Unity

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

Unknown problem - importing tile map #101

Closed JoshElgar closed 7 years ago

JoshElgar commented 7 years ago

image

The above is the output from Tiled2Unity after clicking the big export button. Below are the errors I received in Unity upon importing.

image

The map looks strange when placed and in the project view, only having the base outline:

image

Am I doing something wrong?

Seanba commented 7 years ago

That polygon path warning is an indication to you that your colliders are not being merged into a (much) smaller number of polygon paths. I suspect that is because of the way you've created colliders on your tiles in the Tiled Collision Editor. It is must commonly caused when you are not using grid-snapping.

The other error is much more serious. Can you send me your exported map1.tiled2unity.xml file?

JoshElgar commented 7 years ago

Sure, sorry for taking a while, posted this when I went to bed. I couldn't attach the XML file because Github doesn't support it apparently, so I just zipped it, hopefully that works.

map1.tiled2unity.xml.zip

JoshElgar commented 7 years ago

Update: Just fixed the colliders :) Exports perfectly, no errors. Cheers! Update 2: Weird, still seems to be the same problem once in Unity - image

The errors in Unity: image

xml (after fixing colliders):

map1.tiled2unity.xml.zip

Seanba commented 7 years ago

The problem is with your texture name: 32x32_map_tile v3.1.png

It has an extra period so the Tiled2Unity scripts are getting confused trying to find the material asset after it is imported. I'll fix the scripts to handle this case but in the meantime if you name your texture something a bit "friendlier" like 32x32_map_tile_v3_1.png then you'll get things working.

JoshElgar commented 7 years ago

Thank you very much!

Seanba commented 7 years ago

Thanks, Josh, glad it's working for you. However, I'm going to keep this open until I release a version of Tiled2Unity that handles material names a bit better. Should be just a couple of days.

Seanba commented 7 years ago

Tiled2Unity 1.0.12.1 contains the fix for this. Thanks again for the bug report.