An issue with supertiled2unity

Hi, I know that these are the Tiled forums but I figured that you all would know how to use SuperTiled2Unity pretty well and these would be more active then any other forums on the subject, so I’ve been having trouble importing tile maps into unity using SuperTiled2Unity, whenever I try I get an error saying there are missing files or the files failed to import even though I have all the files in the folder together. Are there any solutions? This has been an issue for months.

Thanks

Were the files together before you put them into the ST2U import folder? If the files were previously in different directories, then the references to the other files will have gotten broken when the relative positions of the files changed.

Try to open the files in your import directory in Tiled, and it shoukd prompt you to find the missing files. When you do, save the changes, and ST2U should import the files correctly.

1 Like

Hi, I’ve been able to resolve one error but another one comes up, I have all my assets (.tsx .png and .tmx) files in the same place (a folder on my desktop) as well as the Imports folder in ST2U but I still get this error

SuperTiled2Unity version: 1.10.3, Unity version: 2019.4.30f1
Invalid rectangle (Tile ID =‘117’) in tileset ‘base tileset’ has zero width

Im at a loss, any solutions?

Are you using Tiled’s built-in collision feature? If so, go to tile 117 in that tileset and make sure that any collision rectangles set up there have a non-zero size. Zero-size rectangles show up as larger than 0x0 in Tiled, but they can happen if you place rectangles by clicking instead of dragging. You can view/edit the size by selecting the rectangle and seeing its dimensions in the Properties panel.

2 Likes

It worked! thx so much this has been an issue for months, I just have one more question the collisions aren’t working is there some easy fix or amI just being stupid?

thx again

I can’t give you details since I don’t use Unity, but IIRC in Unity collisions have several layers, and you need to make sure your characters are set to collide with the one that has the imported collisions.