Seanba / Tiled2Unity

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

Error Finding Textures #179

Closed Sparta93821 closed 5 years ago

Sparta93821 commented 5 years ago

I am trying to add a map to my Unity game that I created in Tiled, but when I export it, I get this error; Error creating material 'tileset.mat'. Texture was not found: Assets/Sprites/tileset.png UnityEngine.Debug:LogError(Object) Tiled2Unity.ImportBehaviour:RecordError(String, Object[]) (at Assets/Tiled2Unity/Scripts/Runtime/ImportBehaviour.cs:172) Tiled2Unity.ImportTiled2Unity:AssignTextureAssetToMaterial(Material, String, String, ImportBehaviour) (at Assets/Tiled2Unity/Scripts/Editor/ImportTiled2Unity.Material.cs:161) Tiled2Unity.ImportTiled2Unity:ImportAllMaterials(ImportBehaviour) (at Assets/Tiled2Unity/Scripts/Editor/ImportTiled2Unity.Material.cs:142) Tiled2Unity.ImportTiled2Unity:ImportAllTextures(ImportBehaviour) (at Assets/Tiled2Unity/Scripts/Editor/ImportTiled2Unity.Texture.cs:61) Tiled2Unity.ImportTiled2Unity:ImportBegin(String, ImportTiled2Unity) (at Assets/Tiled2Unity/Scripts/Editor/ImportTiled2Unity.Xml.cs:40) Tiled2Unity.TiledAssetPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Assets/Tiled2Unity/Scripts/Editor/TiledAssetPostProcessor.cs:83) UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])

No errors show up on the executable Tiled2Unity and I can preview the map just perfectly. When the map is imported, I get the above error and although I can place the prefab, it is blank and the Sprites have no texture. If there is any other information that could help you fix this problem, simply ask.

Thanks for any help!

Sparta93821 commented 5 years ago

I have determined that it is a problem with that particular tiled file - I was able to import a blank file with no problems... I will try recreating the tiled map from scratch.

Sparta93821 commented 5 years ago

The second I place any tiles on the map however, it fails to import with the same error...

Sparta93821 commented 5 years ago

Problem solved! When creating a new tileset, I wasn't embedding the tileset in the map, so it couldn't reference the tileset. (This post can be marked as solved).