Seanba / Tiled2Unity

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

Colission Layer not in Unity #57

Closed philphilphil closed 8 years ago

philphilphil commented 8 years ago

I'm not sure if its my fault or if its a bug. Sorry in advance if its my mistake. I read up on the Website and it's guides, Googled and watched YouTube videos and i can just not see what i'm doing wrong.

I made a very simple map in Tiled, when Importing it to Tiled2Unity the preview is showing the collision tiles image

When using the mesh in Unity the collision layer is not showing up. image I tried reimport, refresh, restarting unity, complete empty new unity project, new tiled project.

Tiled version: 0.17.0 Tiled2Unity version: 1.0.7.7 on Win10 64bit Unity3d version: 5.4.0f3 Personal

Link to the tiled file: https://www.dropbox.com/sh/nj98euvt2bcqfqf/AABt30AgHfrSuuHKaZG_vJFca?dl=0

Log output

Opening C:\Users\Philipp\Desktop\collisiondebug.tmx ...
Parsing map root ...
Parsing tileset elements ...
Parse internal tileset 'spaceTest' (gid = 1) ...
Added 1767 tiles
Parse tile data (gid = 641, id 640) ...
Parsing objects in object group ''
Parsing object ...
Parsing layer elements ...
Parse bg layer data ...
Parsing layer data as CSV ...
Parse trees layer data ...
Parsing layer data as CSV ...
Parsing objectgroup elements ...
Map details: { "0" size = 25x25, tile size = 16x16, # tiles = 1767, # layers = 2, # obj groups = 0 }
Parsed: C:\Users\Philipp\Desktop\collisiondebug.tmx 
--------------------------------------------------------------------------------
Loading summary
Succeeded: 1
  Parsed: C:\Users\Philipp\Desktop\collisiondebug.tmx 
Warnings: 0
Errors: 0
--------------------------------------------------------------------------------
Exporting 'C:\Users\Philipp\Desktop\collisiondebug.tmx' to 'C:\Users\Philipp\Dropbox\Projekte\Games\CollisionTest\Assets\Tiled2Unity'
Compiling tiled2unity file: collisiondebug.tiled2unity.xml
Writing 'mesh_0001' mesh group
Writing 'mesh_0002' mesh group
Writing face vertices
Writing face uv coordinates
ImportTexture : will import 'C:\tmp\spaceTest.png' to C:\Users\Philipp\Dropbox\Projekte\Games\CollisionTest\Assets\Tiled2Unity\Textures
Gathering prefab data ...
Clipping '' polygons: 0%
Clipping '' polygons: 100%
Writing as Xml ...
Exporting to: C:\Users\Philipp\Dropbox\Projekte\Games\CollisionTest\Assets\Tiled2Unity\Imported\collisiondebug.tiled2unity.xml
Succesfully exported: C:\Users\Philipp\Dropbox\Projekte\Games\CollisionTest\Assets\Tiled2Unity\Imported\collisiondebug.tiled2unity.xml
  Vertex Scale = 1
  Object Type Xml = <none>
--------------------------------------------------------------------------------
Exporting summary
Succeeded: 1
  Succesfully exported: C:\Users\Philipp\Dropbox\Projekte\Games\CollisionTest\Assets\Tiled2Unity\Imported\collisiondebug.tiled2unity.xml
  Vertex Scale = 1
  Object Type Xml = <none>
Warnings: 0
Errors: 0
--------------------------------------------------------------------------------

Thank you

Seanba commented 8 years ago

Hi Phil. Can you send me your collisiondebug.tiled2unity.xml file? You can find my email on my website: www.seanba.com

philphilphil commented 8 years ago

Thank you for the quick response, i just sent you the xml

Seanba commented 8 years ago

Oh, I think I see the problem now. It looks like you put the mesh into your scene. You need put the prefab into your scene instead. (See the Prefabs folder)

FWIW, I was able to import your XML file without issue. I see the layers and collisions.

philphilphil commented 8 years ago

... thank you. i have no idea how i could miss that..