Tiled2Unity: Tiled Support for Unity

Tiled on Patreon Support Tiled Map Editor on Patreon
Please consider supporting Tiled Map Editor on Patreon. Tiled is a free and essential tool for 2D game development and I’d like to see the author support it and similar tools fulltime.  We’d have no Tiled2Unity without it.

Tiled2Unity Downloads

Tiled2Unity is a free utility with one goal in mind: Easy exporting of Tiled Map Editor TMX files into your Unity projects. Tiled2Unity takes your Tiled files and creates Unity prefabs from them that are easily placed into your Unity scene. Complex collision is supported through Unity’s PolygonCollider2D class. (Windows and Mac)

Tiled2UnityLite is a command line version of the Tiled2Unity utility. It can be used on any platform but was primarily designed to give Linux users a way to use Tiled2Unity on their operating system.

Updating Tiled2Unity

When you install a new Tiled2Unity version you will also want to update the Tiled2Unity scripts in your Unity project folder as well. The easiest way to accomplish this is through the Import Unity Package to Project menu item while your project is open in Unity.

Easily update your Tiled2Unity scripts

Note: Both the Tiled2Unity output window and the Unity console will complain if there is a mismatch.

All Source is Freely Available on GitHub

Tiled2Unity is made up of two parts:

  1. The Tiled2Unity utility that exports a Tiled file.
  2. The Tiled2Unity Unity scripts that imports the *.tiled2unity.xml files and puts the textures, meshes, and prefabs into your Unity project.

Both components are publicly available on GitHub.

Tiled2Unity on GitHub

Learning Tiled2Unity

I’ve tried to make Tiled2Unity simple to use and understand. Here’s some links that may help you out:

  • Introduction: Use the test TMX files supplied with Tiled2Unity to create two simple scenes in your Unity project (one with sloped collision).
  • Tiled2Unity Scale: By default, Unity 2D sprites use a coordinate system where 100 pixels equals 1 unit in Unity. I think that’s crazy but this link will show you how to live in that world.
  • Mega Dad Adventures: A good number of “advanced” examples of using Tiled2Unity in your Unity projects. Set tags and layers on your imported prefabs and add custom, game-specific behavior.
  • Tile EdgeCollider2D Support: Shows you how you can use polylines in the Tile Collision Editor to export EdgeCollider2D objects in your Unity prefab.
  • Getting Tile Information at Runtime: Useful for Strategy and RPG style games.
  • Introducing Tild2UnityLite: Use Tiled2Unity as a command line utility on PC, Mac, or Linux.

Feel Free to Contact Me

If you’re making something with Tiled2Unity I’d love to hear about it. I also welcome bug reports with big hugs — although my real life schedule may keep me busy at times. In any case, email me your suggestions or awesome stuff.

Tiled2Unity History

Version 1.0.7.4

  • Bug Fix: Fixed math on texture coordinates for rotated tiles (was causing seams)
  • Bug Fix: Isometric tiles that were added to Tiled as a collection of images were being placed incorrectly in generated prefab
  • Bug Fix: Clear Object Types button Tiled2UnityMac was not hooked up.

Version 1.0.7.3

  • Bug Fix: Decomposing polygons into convex groups would sometimes throw an exception in the triangulation stage.

Version 1.0.7.2

  • Bug Fix: Exporting Tiled files that reference “internal textures” (i.e. textures already part of the Unity project) has been fixed.

Version 1.0.7.1

  • Improved Feature: Vertex Scaling was replaced with “Pixels Per Unit” so that it mapped exactly with what Unity is using to scale sprites.
  • Bug Fix: Fixed exception when importing textures that used an alpha color key.

Version 1.0.7.0

  • Bug Fix: Maps that were referencing the same texture were being invalidated upon export.
  • New Platform: Tiled2UnityMac is now available. Mac users can now use Tiled2Unity in the same way that Windows users have long enjoyed.

Version 1.0.6.0

  • New Feature: Can now use depth buffer shaders in cases where you want a sprite to draw above or below a tile depending on its position in the world. (Sprite will need to set its z-position, see SpriteDepthInMap component)
  • Bug Fix: Tile Objects in Isometric maps have their position and collision geometry properly set now.

Version 1.0.5.1

  • Bug Fix: Recently added support for Object Types introduced a crashing bug when using unity:sortingOrder custom attribute.

Version 1.0.5.0

  • New Feature: Object Types now supported. Default property values for Objects will be exported to Unity.
  • New Feature: Multiple collider types on same Tile Layer. You no longer have to manage separate layers for specific collision types.

Version 1.0.4.7

  • Bug fix: No longer crashes if Tiled map file layers reference tiles that no longer exist.

Version 1.0.4.6

  • Bug fix: TMX files with extra periods in their file name can be successfully imported now.
  • Bug fix: Fixed shader issue with some Android hardware by simplifying and re-arranging shaders.

Version 1.0.4.5

  • New 64 bit version: Provides better stability with large maps that could run out of memory in the 32 bit version.
  • Bug fixes: Reduction in memory usage reduces risk of running out of memory while opening or exporting TMX files.
  • Improved previewer: Rendering map previews is 2-3 times faster now.
  • Improved reporting: Users trying to import while using the Unity Web Player should have a clearer message now.

Version 1.0.4.4

  • Unity 4.x Support: By popular demand Tiled2Unity will work with Unity 4.x installs.
  • Bug fix: Unity scripts no longer throw exception when trying to re-import a Tiled2Unity folder

Version 1.0.4.3

  • New Installer: The NSIS-based installer was being falsely flagged as malicious by some anti-virus software. Now using an MSI installer package.
  • Improved reporting: Will now be warned if you try to export a Tiled map that has a PolygonCollider2D that is “too complicated”. (This usually means you set up colliders in Tiled without using “Snap to (Fine) Grid”.
  • Bug fix: Removed GDI+ library dependency that was crashing some Mac users in Tiled2UnityLite.
  • Bug fix: Fixed crash with Tiled maps that contain only Image Layers.

Version 1.0.4.2

  • Bug fix: Fixed unity:convex not being interpreted as a boolean.

Version 1.0.4.0

  • New Feature: Now supports rotated Tile Collision Editor colliders from Tiled.
  • Bug fix: No longer crashes if Tiled2Unity cannot find installed Tiled2Unity.unitypackage file.

Version 1.0.3.0

  • New Feature: Can now choose to export polygon collisions as a series of convex polygons instead of one “complex” polygon that may have holes and convex edges.
  • Bug fix: Fixed crashing bug when extra tile data remained in a TMX file for a tile that has been removed from a tileset.
  • Bug fix: Will no longer crash if unity:sortOrder property value is not an integer (reports an error instead).
  • Improved Feature: Tile Objects can set their own sort layer name and sort order.

Version 1.0.2.4

  • Bug fix: Fixed exporter crash when tileset image file cannot be found.
  • Bug fix: Fixed exporter crash when old tile data remains in TMX file from a tile that has been removed.
  • Bug fix: Fixed exporter crash after removing tile from “Collection of Images” tileset.

Version 1.0.2.3

  • Bug fix: Reverted normal on map meshes back to (0, 0, -1) as positive-z goes “into” the screen.

Version 1.0.2.2

  • Bug fix: Generated meshes are using the proper normal vector for lighting. (This was a mistake. Reverted in 1.0.2.3)
  • Improvement: Tiled2Unity can be used in WebPlayer builds again. However, you must import your Tiled maps using another build target first (Standalone Windows/Mac/Linux will do).

Version 1.0.2.1

  • Bug fix: Fixed compile error with Unity 5.0
  • Bug fix: Fixed string exception being thrown when (re)importing Tiled2Unity.xml.txt marker file.

Version 1.0.2.0

  • New Feature: Added support for unity:resourcePath custom property on Tiled maps. This instructs Tiled2Unity to build the map prefab at Tiled2Unity/Prefabs/YourExtraPathHere/map.prefab

Version 1.0.1.2

  • Bug Fix: Fixed bug with importer getting stuck when saving a prefab to the Resources folder.

Version 1.0.1.1

  • Bug Fix: Replace compile error CS0234 with notification that Unity Web Player is no longer supported.

Version 1.0.1.0

  • Bug Fix: Fixed compile error when importing with earlier versions of Unity 5.x (5.0, 5.1, and 5.2)

Version 1.0.0.2

  • Big Fix: Fixed compile error when building the Unity player.

Version 1.0.0.1

  • Bug Fix: Textures used only for Tile Objects were not being exported to Unity
  • Bug Fix: Tile Objects were not placed correctly when used with vertex scaling

Version 1.0.0.0

  • Optimized: Animated tiles no longer manipulate vertex data. This is a significant optimization. Additionally, tile animations no longer cause garbage collection spikes.
  • Optimized: Importing *.tiled2unity.xml files is now significantly faster, especially for larger maps.
  • Bug Fix: Colliders on Tile Objects now alligned properly with the origin of the Object.
  • New Feature: Tile Objects now supported visually.
  • Deprecated: Unity 4.x versions no longer supported.

Version 0.9.13.1

  • Bug Fix: Tiles that were rotated and/or flipped could introduce seams depending on camera settings.

Version 0.9.13.0

  • New Feature: Tileset Offset property is considered in placing tiles (Note: This could lead to overlapping tiles that don’t sort as you may expect. Prefer to use Layer Offset instead.)
  • Modified Feature: unity:ignore custom property can be assigned to false, true (ignores whole layer), collision (ignores collision on layer but exports visuals), and visual (ignores visual tiles on layer, exports collision only).
  • Bug Fix: Image Layers with no image no longer crash Tiled2Unity
  • Bug Fix: Fixed compile issue with older versions of Unity

Version 0.9.12.0

  • New Feature: Tiled Image Layers are now supported.
  • New Feature: Layer Opacity is now supported.
  • New Feature: Layer Horizontal and Vertical Offset is now supported. (Currently only in the Tiled daily build. Will automatically work in Tiled2Unity when feature goes live.)

Version 0.9.11.2

  • Bug Fix: Command line argument that selected your Tiled2Unity export folder has been fixed (broken by 0.9.11.0).

Version 0.9.11.1

  • Bug Fix: Scripts updated for Unity 5.1 (previous versions of Unity 5 and Unity 4.x are back supported).

Version 0.9.11.0

  • New Feature: Tiled2Unity now works at any location in your Unity project. It no longer has a hard-coded dependency on being located at Your/Unity/Project/Assets/Tiled2Unity.
  • New Feature: Add the unity:resource property to your collection of Map properties in Tiled so that the prefab is saved to the .../Tiled2Unity/Prefabs/Resources directory. This allows you to instantiate the prefab via script in your Unity game.
  • Potential Bug Fixes: All DLLImport unmanaged code has been removed from the Tiled2Unity utility. This should make life easier on anyone porting Tiled2Unity to a non-Windows platform.

 Version 0.9.10.0

  • New Feature: Isometric and Hexagonal maps now supported.
  • Bug Fix: Using NonZero polygon fill rules when combining collision geometry now so that overlapping polygons don’t create holes.

Version 0.9.9.4

  • Bug Fix: Some animated tiles were still broken when using vertex scaling.

Version 0.9.9.3

  • Bug Fix: Animated tiles are working again in maps that use vertex scaling.

Version 0.9.9.2

  • Bug Fix: Fixed script compile errors while using Unity 4.x.

Version 0.9.9.1

  • New Feature: Updated to work with Unity 5 without any modifications.
  • New Feature: Added Preview Options to previewer. Improved the look of collision geometry in the previewer.

Version 0.9.9.0

  • New feature: Object rotation now supported.
  • New feature: New unity:collisionOnly property on Tiled layers will export only the collision data from the given. Meshes will not be generated.
  • Improvement: Previewer no longer contains seams when using zoom.
  • Improvement: UI added for modifying vertex scale. No longer have to rely on –s or -–scale command line arguments alone.
  • Bug fix: Tiled2Unity would crash if you entered a value for a boolean property which didn’t resolve to true or false.

Version 0.9.8.0

  • New feature: Vertex scaling through command-line argument (-s or -–scale). The vertices of the exported maps and collision maps will be multiplied by this value. For some users this will be a better way to control the size of map instead of scaling the whole prefab.
  • New feature: Texel bias setting exposed through command line-argument (-t or -–texel-bias). This helps when using some shaders that under certain conditions give the appearance of seams in the tiled map.

Version 0.9.7.4

  • Bug fix: Exporting would crash if you had a Tile Object in an Object Layer that had no custom properties.

Version 0.9.7.3

  • Bug fix: Gizmo selection of TiledMap prefab takes scale into consideration.
  • Bug fix: TMX files with extra period characters in the file name are supported.
  • Bug fix: Texture files referenced by Tiled maps with extra period characters in the file name are supported.

Version 0.9.7.2

  • Bug fix: Gizmo selection of TiledMap prefab now takes world position of game object into account.

Version 0.9.7.1

  • New feature: Preview in Tiled2Unity exporter supports 1/8th to 800% zoom. Allows preview of maps that were once too large to preview.
  • New feature: New unity:ignore property allows you to have layers in Tiled that are ignored by the exporter.
  • New feature: New TiledMap component is added to imported map prefabs automatically, containing dimensions of map.

Version 0.9.6.1

  • Bug fix: SortingLayerExposedEditor class no longer collides with Editor namespace.
  • Bug fix: Changes made to texture importers by hand are not overwritten on subsequent exports to Unity.

Version 0.9.6.0

  • New feature: unity:isTrigger support added.
  • Bug fix: Fixed bug with rotated tile collision geometry in cases where collision data had a non-zero position relative to the tile.

Version 0.9.5.4

  • Bug fix: Animated tiles were not working if Unity split the mesh into smaller sub-meshes
  • Bug fix: On some graphics hardware and resolutions, dark edges were appearing on the upper and left side of tile boundaries

Version 0.9.5.3

  • New feature: Render order of tiles supported
  • New feature: Animated tiles supported through Tiled Animation Editor

Version 0.9.4.6

  • Bug fix: Margin settings for textures follow same rules as Tiled.

Version 0.9.4.5

  • Bug fix: Rotated tiles often had incorrect texture coordinates in generated mesh.

Version 0.9.4.4

  • Bug fix: Added a bias to generated texture coordinates. This should resolve issues with seams that some users were seeing.

Version 0.9.4.3

  • Bug fix: Unity was renaming our generated meshes under some conditions.

Version 0.9.4.2

  • Fixed bug where textures with whitespace in their name we’re not being assigned to their matching material and meshes during import.
  • Exported *.tiled2unity.xml files are always re-imported now when exported, even if the data hasn’t changed.

Version 0.9.4.1

  • Fixes texture coordinate bug with some flipped or rotated tiles.

Version 0.9.4.0

  • Tiles (including collisions) that are flipped or rotated in Tiled Map Editor are now supported.
  • Tiled maps with flipped or rotated tiles no longer crash Tiled2Unity.
  • Several speed improvements. Useful for viewing and exporting “large” Tiled maps.

Version 0.9.3.0

  • Polylines added to tiles in the Tile Collision Editor (in Tiled) are exported as EdgeCollider2D objects.

{ 35 comments… read them below or add one }

Russell August 26, 2015 at 6:57 pm

Hi there. You made a great work. Can you help me with one problem? How can i get tiled-map size? I need it to control my camera bounds. Or it could be done in another way?

Candescence September 5, 2015 at 3:22 am

Hey, Sean, I’ve noticed that the vertex scaling import is inaccurate, especially if you use the tile map size (aka one tile is the same size as a unity unit), as suggested by Adam in the post where you detailed vertex scaling. For example, a 32×32 tile ends up being slightly larger than a unity unit (by almost an entire pixel), which, as a result, adds up until the actual position of the tiles are completely off. This is something of a big deal for all sorts of reasons, so you probably should fix that.

Candescence September 5, 2015 at 3:37 am

PS: I actually tried rescalling the tilemap manually and the closest exact scale factor I could get it to that should be its proper size was roughly 0.9765624. Which means the original scale of the tiles was off by roughly 0.0234376. Tiny, but again, a huge deal, as it adds up very quickly.

Seanba September 20, 2015 at 9:54 am

Keep in mind that for vertex scaling, the formula to use is 1 / (size of tile) as opposed to (size of tile) / 100. In other words, if you want to treat 1 unit as 32 pixels then use 1/32, not 32/100.

Async September 25, 2015 at 4:53 pm

Seanba, could something similar to what is in 0.9.13.0 (ignore: collision, etc), but to allow unique tiles to be generated if they contain special map tile properties be added in a future version?(not even generated, but handled by a custom importer would be good enough)

Basically a pass-through to allow a custom-importer in Unity to process all tiles in a specified layer, by itself.

Adam November 30, 2015 at 8:55 am

Hey Seanba, great tool you have made, love it a lot. I have however encountered a problem. I load my map into Tiled2unity and everything goes fine. But when I try to open my project it gets stuck importing on ‘NameOfMap’.obj. The map is large in size but I have tried to break it up into pieces but still no luck. Another guess of mine is that maybe its the collision. Love to hear back from you.
Thanks

Seanba sez: I would guess it’s the size of your map. Unity tries it best to cut up large meshes into smaller ones but sometimes gets stuck in the process. Can you send me your *.tiled2Unity.xml file that it is trying to import?

Alex December 2, 2015 at 9:26 pm

Thanks so much for this program, Sean! It’s help tremendously with my game already, but I’m having a bit of a problem. I made a large map, but I had to create 900 or so layers to get an effect that I wanted. Over 890 of the layers only have up to 4 tiles or less, but it’s making me get an error due to the file being too big. I need these different layers to appear individually to make a path be built as you progress forward through the map, but I don’t know if this size will work for being imported. Is there any way that I can import this correctly by changing layers, or at least create more memory in the program itself? Thanks in advance!

Seanba sez: Hi Alex. I don’t think that number of layers should be a problem, especially given 99% of them only have 4 tiles (But maybe it’s a DOM thing? I don’t know.). Can you be more specific about the error? What is the error? Are you getting it in the Tiled2Unity utility or in Unity? Could you send me an example of a Tiled file (don’t forget the tileset textures!) that are causing this?

Nick December 18, 2015 at 4:59 pm

hello to your program does not support layer objects. do you plan to change it?

Seanba sez: Hi Nick, the latest version of Tiled2Unity has better support of layer objects. In particular you can have Tile Objects in your Object Layers now that will show up in your exported maps.

Nick December 26, 2015 at 5:26 am

Hi Sean, I use the latest version of the converter (Download the 0.9.13.1 Win32 Installer here). Layer objects I use to decorate the environment. When you try to move the map in unity5 constantly get an error. When you remove a layer of objects, everything is done correctly. Nowhere did I find the latest version(Version 1.0.0.0)

Seanba sez: The latest version is always at the top of this post (try the download buttons)

Matthias December 28, 2015 at 12:28 pm

Hi Sean,

I’m getting a script error on import (Import Unity Package to Project) in TiledAssetPostProcessor; using v 1.0.0.2 and 5.2.3f1, this prevents any prefab from being created

Seanba sez: This is fixed now. The problem was Unity 5.0-5.2 didn’t support a function I was using.

ricard December 31, 2015 at 1:23 am

how to run on mac ????

Seanba sez: Directions are coming in the next day. Mac support was just added a couple of hours ago. The gist is you will use Tiled2UnityLite.cs as a command line tool through CS-Script.

Seanba sez, part 2: See this link for instructions on Mac.
http://www.seanba.com/introducing-tiled2unitylite.html

ricard January 4, 2016 at 2:59 am

thx 🙂

Thomas January 18, 2016 at 1:51 pm

Hello, i have been having a problem making the prefab, the XML file is in the import folder, but the script hasn’t converted the file into a prefab?

Thanks for your time!

Seanba sez: It’s always a good idea to check the Unity Console Window for any errors. I try to make sure problems are reported there. Chances are you are running Unity with the deprecated Web Player as the build target. Check the console if that’s the case and switch to something like Standalone Windows/Mac/Linux as the build target instead.

Thomas January 19, 2016 at 4:14 am

Thanks that worked a charm it was the problem you said, i changing it to Windows/Mac/Linux.

Thanks Again.

link January 19, 2016 at 8:33 am

thanks a lot!!!

dope250 February 9, 2016 at 10:38 am

Hi!
If I import the unitypackage the unity console says “There is an error with your Tiled2Unity install. Could not find Tiled2Unity folder in ProjectSettings/ProjectSettings.asset”. But the Tiled2Unity folder is correctly copied in my projects “Assets”. What I’m doing wrong?
Using Unity 5.3.1f.
Greetings from Germany!

Leandro Nucci February 10, 2016 at 8:18 pm

Hello, if i export to mobile 2 layers will be invisible, how i can fix it?

Seanba sez: Hi Leandro, I would expect all layers to be visible on mobile devices although I have to admit I haven’t tested it (but others have used it fine). If this buggy behavior could be replicated on one of the other build targets that comes stock with Unity then I’m sure I could figure out what is going on.

Leandro Nucci February 10, 2016 at 9:10 pm

Hi!

I Cant use it in mobile games?

Seanba sez: You should be able to run on mobile devices just fine. However, I’m not a mobile developer and as such don’t have the iOS or Android modules installed. I do know that other developers have been able to run Tiled2Unity on those devices though.

Jake February 11, 2016 at 3:14 pm

Hi,
I have a similar problem to Thomas, when i export the tiled map, there is only an XML file in the import folder but the script hasn’t converted the file into a prefab that i can use. But the solution that you said doesn’t help as, as far as i can tell i am running a Windows/Mac/Linux build and i am still getting the error.
Anything else i can do or check that may help?

There is also an error in the console which i am not sure what exactly it is (im fairly new to unity, but i know the basics), this is what it displays:
Assets/Tiled2Unity/Scripts/Runtime/TileAnimator.cs(10,19): error CS0234: The type or namespace name `Assertions’ does not exist in the namespace `UnityEngine’. Are you missing an assembly reference?

Can you please help? Thanks.

Seanba sez:Hi Jake, my guess is that you are using a flavor of Unity 4 and that is no longer supported. If you go to the Tiled2Unity download page you can get an old version that is compatible with Unity 4 but I would recommend upgrading Unity instead.

Kylle February 12, 2016 at 1:47 am

Hi, I have the same problem as Jake and Thomas, XML file is in the import folder but the script hasn’t converted the file into a prefab.
Every time I try to import the tile map it always stops at “Assign material: mesh_0005”. I’m running a Windows/Mac/Linux build and I’m using the latest version of Unity and Tiled2Unity.

Help me please, thanks.

Seanba sez: This was due to Tiled2Unity being installed at “Assets/tiled2unity” instead of “Assets/Tiled2Unity”. I don’t know why the project folder is lower-case but the next version of Tiled2Unity will work with lower or upper case.

Jake February 12, 2016 at 12:44 pm

Hi again,
I have updated my unity from 4.x to 5.1.4 and it got rid of the console error that i was getting, thanks.
But now when i export my map into unity, while it is loading the bar stops as it is making the meshes and will not load any further. I have tried waiting a while, restarting, downloading version 5.2.4 of unity, and also just recently updated Tiled2Unity from 1.0.4.0 to 1.0.4.2, but i am still getting the same problem.
Any ideas that can help? Thanks.

Seanba sez: Hi Jake. Constructing a PolygonCollider2D instance slows to a crawl if your collision geometry is complex. This is most likely due to making polygon and rectangle objects in Tiled’s “Tile Collision Editor” without using “Snap to Grid” or “Snap to Fine Grid”. With sub-pixel coordinates your colliders from neighboring tiles are failing to merge. I’m working on a version of Tiled2Unity that will warn you of this since it seems to be a common user pattern.

duppie February 19, 2016 at 11:14 am

I did every step correctly according to https://www.youtube.com/watch?v=7ZLtXFnF5Js&list=PL_4rJ_acBNMH3SExL3yIOzaqj5IP5CJLC&index=3, but when i choose my project to import my map( maked with Tiled), it says:
Tiled2Unity.export.txt
Can’t find the file.
Check the name and try again.
I also tried with all the other possible names I can think off, but it is saying that always.
pls halp 🙁

Seanba sez: Hi duppie. I *think* what you’re explaining here is the open file dialog when you click the “Export To …” button in Tiled2Unity? You need to use that to traverse to the Tiled2Unity folder in your Unity project and select the Tiled2Unity.export.txt that is there. That is how Tiled2Unity knows where to export your files to.

Valerie February 22, 2016 at 12:33 am

Hey there,

I must say your tool is pure magic and saved me a TON of time! But… I have the same problem as Jake above… I did an export once. Did a playtest and ended up changing the layout a bit and now it gets stuck when the Meshes are being generated in Unity. Not sure what to do :S Anything you can offer to help? Thanks 🙂

Oh… I’m using:
Unity : 5.3.2f1
Tiled2Unity : 1.0.4.2
Tiled : 0.15.1

Seanba sez: Chances are strong this is due to using Tiled’s “Tile Collision Editor” without using “Snap to Grid” or “Snap to Fine Grid”. Without this, you end up with sub-pixel coordinates that keep neighboring polygon/rectangle objects from being merged. That results in very slow importing as Unity struggles to create a PolygonCollider2D with a lot of paths in it. I’m working on a new version of Tiled2Unity that warns users at export time of this.

Josh February 22, 2016 at 1:03 pm

I love the tool, I used to use it in Unity 4 and haven’t used it for awhile, I am now trying to use it with Unity 5.2.1 and whenever I load it the prefab never shows up. The target is standalone, and like duppie said, I followed the same tutorial using my Tiled2Unity.export.txt as the target, I hit the big ass export button and it goes, no errors in either unity or your tool and says successful yet there is no prefab.

Unity : 5.3.2f1
Tiled2Unity : 1.0.4.2
Tiled : 0.15.1

Any ideas?

Ricardo March 1, 2016 at 12:50 am

I just tried to download T2U, but Chrome claimed a virus was detected. I’m using Windows 7 Home Premium, and whatever the latest version of MSE is. False positive?

Seanba sez: Yes, false positive. It happens every time I update Tiled2Unity. When I get some time I’m going to look into using a different installer. You can always you the zip in the meantime if you’re worried about it.

Python March 10, 2016 at 10:48 am

I have not downloaded Tiled2Unity but I have seen a video explaining how to use this tool. One question comes to my mind:

I saw that your program uses PolygonColliders2D for the collisions. Is it possible to use BoxColliders2D instead, as I will only need boxes?

Thanks

Seanba sez: Hi Python, with a BoxCollider2D instance for each tile any map of appreciable size will quickly explode to having many thousands of such components on it — so much so that it will be unmanageable and/or degrade performance. Combining colliders into polygons greatly reduces the object count by several orders of magnitude. So, short answer is “no” this isn’t supported. However, through some clever use of Tiled automapping you could have each tile create a box object which will get exported as a bunch of separate box colliders. I recommend against that approach though due to the concerns already mentioned. Is there a reason why you can’t do collision checks against polygon colliders in any case? That would be by far the best approach.

Bill March 18, 2016 at 4:54 am

I’m a new user to tiled and your utility and I’m having an issue with object properties. I created a test map and added a couple of objects. In each of those objects I added a couple of custom properties. I used your util and imported the data into unity. Everything seems to work like it should, but I don’t see the property values anywhere.

If I look at the xml that was imported into unity, the properties are in the file, but just not shown in unity at all. Is there something else I need to setup to get access to the data in unity?

thanks.

Seanba sez: Hi Bill, custom properties need to be acted upon through additional code that you will write in your own Custom Importer class. You can read more about Custom Importers in my post here.

sponge April 13, 2016 at 12:05 pm

Is it feasible to integrate Tiled2UnityLite inside the Unity app directly to build the geometry at runtime from the tmx? I’d like to account for people loading custom maps in the future, but it seems between the converter and then possibly editor scripts, the build process for maps not packaged in the game might be tough. I’m not overly familiar with Unity, so I’m not sure in general how game modes of Unity games work.

Seanba sez: Hi sponge, I originally considered having Tiled2Unity fully contained as Unity scripts but there is some C# syntax/libs/etc. that are not available in the Mono-powered C# implementation used by Unity. If I were to do Tiled2Unity all over again I’d actually do it in C++ and rally to have it added to Tiled. (At the time it was a tool I didn’t plan to release for public consumption)

Ben April 14, 2016 at 10:45 pm

Hey Sean, I’ve been using your utility to import and update my game map for a while now, and I recently added another tileset to my map that’s giving me trouble with the utility. It’s an exceptionally oddly proportioned file (256×16704) and the import results in incredibly distorted tiles, with the preview in the materials pane in unity looking like smears of color, while textures maintains the image correctly.

Do you know what could be causing this and if there’s a way to fix it besides cutting up the tileset and remapping it?

Seanba sez: Hi Ben. Look at the texture importer settings for that textures in Unity. By default, Unity has a max texture size of 2048×2048 so your file is being re-sized and you’re losing pixel data in the process (end result is everything looks washed out). You can change the max size of the texture in the importer settings but I don’t think Unity will allow you to go any higher than 8192×8192 — so you’ll have no choice but to cut your texture up and remap, I’m afraid.

Daniel Larson May 17, 2016 at 5:57 pm

Hi Sean, this tool is AMAZING.

I have a question about the new Object support. I was redoing your MegaDad Water scene as all one layer (mostly for fun) using some of the newer Tiled features and I can’t figure out how to export as a trigger for object types. unity:layer for my water type works like a charm and I can navigate to the collider and check isTrigger there and voila, so it’s mostly moot, but it doesn’t import to unity as a trigger, with or without the unity:isTrigger property, and I don’t know if I’m doing something wrong or if it’s a bug or just not supported. I feel like it’d be pretty cool to be able to have that feature without extra layers and more automapping (Though I love me some automapping).

Thanks!

Kylle Reyes June 13, 2016 at 2:22 am

Hi Sean, I have a problem..

You see, I’m using your amazing tool to put Tiled maps to my unity project, then yesterday, my PC crashed(BSOD) while I’m doing my project, the moment I turn on my PC and open my project, some of the tiles that I was working on was gone.. I’ll be glad if you have a fix for this one, my last back-up was 5 days ago and all the work I have done was gone because I can’t fix the tiles, Thanks in advance and God Bless always 😀

Eric Ioha June 27, 2016 at 4:30 pm

Hi Sean,

I have been having a problem where I can successfully import my map into unity with no errors and the preview in Tiled2unity looks right but when I check it in prefabs it’s completely blacked out and unity wont allow me to add it into the scene. I can’t seem to find a solution to the problem and hope you can help.

Thanks

Seanba sez: Hi Eric. This was a bug I fixed with version 1.0.7.2 of Tiled2Unity. Thanks.

Leandro Nucci June 29, 2016 at 6:10 pm

Hi, how i can solve this?

Unknown unity property ‘unity:collisionOnly’ in GameObject ‘Tiled2Unity.TmxLayer’

i need invisible layers :(, thanks!

Leandro Nucci June 29, 2016 at 6:15 pm

Ignore the last post, now i check and use unity:ignore, thank u!

Seanba sez: Cool. And keep in mind that unity:ignore can be used to export visuals only, colliders only, or ignore the whole layer.

Sean Brophy July 2, 2016 at 1:42 pm

Hi Sean,

Can you tell me if your tool supports the latest version of Unity (as of July 2016)?

Seanba sez: Hi Sean. I keep everything up to date as new versions of Unity are released. I generally don’t test out on beta builds though.

Leave a Comment

{ 11 trackbacks }