Seanba / Tiled2Unity

Export Tiled Map Editor (TMX) files into Unity
Other
499 stars 121 forks source link

Vertex numbers in meshes changing into "Infinity" or "NaN" after export #188

Open hengde opened 5 years ago

hengde commented 5 years ago

Several weeks ago I started having an issue with the export process. Other team members are not having this issue, but unfortunately I am both in another city, and the main person using tiled to update our game's maps.

If I make any change to one of our maps' tile layers and then export with Tiled2Unity, it turns the numbers in the .obj files to NaN or infinity. Here is a diff from sourcetree:


 # Vertices (Count = 4)
-v 0 -10 0
-v -1920 -10 0
-v -1920 1070 0
-v 0 1070 0
+v NaN -Infinity 0
+v -Infinity -Infinity 0
+v -Infinity Infinity 0
+v NaN Infinity 0

 # Texture cooridinates (Count = 4)
 vt 0 0

Here is the TMX file, but this is happening to any TMX file I try to edit.

In Unity, there are no errors running the map, but every tile in a tile layer turns black. Our player spawns correctly (in the position specified in tiled) and is controllable, text appears, in-game objects controlled by tiled objects appear, and the platforms are collidable and in the correct places.

I've tried uninstalling and reinstalling our entire repo and both tiled and tiled2unity several times with no luck. I've tried exporting with both tiled2unity versions 10.13 and 10.13.2. I'm running OSX mojave 10.14.2 on a MacBook Pro (Retina, 15-inch, Mid 2014).

Any help is greatly appreciated, thanks in advance.

Seanba commented 5 years ago

Hi there, @hengde. What are you using for a Pixels Per Unit setting? It sounds like a value of zero is being used. Can you paste the contents of the log from the Tiled2Unity exporter?

hengde commented 5 years ago

Yep that was it. Can't believe I missed it, I guess the export button was so big I couldn't see anything else :)

Thanks again!