Tiled2Unity: "Object reference not set to an instance of an object"

I keep getting this error every time when trying to export my .tmx file into Unity:

Object reference not set to an instance of an object

This happens when I try to load the file into Tiled2Unity. It does export successfully to Unity, but it’s all messed up. I read on a Github Forum that it had to do with tile files being changed location. As much as I tried to reconfigure and reload the tilesets I had on my map nothing worked.

So I just started an entirely new map and remade approximately what I had. It still has the same error. I have four layers–a Main layer (with simple house, path, and grass tiles), two object layers (one the door, one the roof), and a collision layer.

Only the Main layer seems corrupted when it imports into Unity.

Can someone provide me with some instructions on how to troubleshoot this? Thank you!

(Sorry for the late reply)

Hi Boon, it sounds like this was a problem with the Tiled2Unity exporter, right? If you were to paste the whole error message (including stacktrace) I may be able to figure out what has gone wrong.

However, I’ve also made a completely new version of Tiled2Unity (called SuperTiled2Unity) that no longer has any dependency on an exporter. Instead, Unity will automatically import your TMX file into a prefab. You may have better luck with that.

1 Like