# Problem when I import a map of tiled

**URL:** <https://discourse.mapeditor.org/t/problem-when-i-import-a-map-of-tiled/5177>\
**Category:** Bugs\
**Created:** [June 28, 2021, 9:24pm UTC](https://discourse.mapeditor.org/t/problem-when-i-import-a-map-of-tiled/5177 "2021-06-28T21:24:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pou](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@Pou](https://discourse.mapeditor.org/u/Pou)\
**Post date:** [June 28, 2021, 9:24pm UTC](https://discourse.mapeditor.org/t/problem-when-i-import-a-map-of-tiled/5177/1 "2021-06-28T21:24:11Z")

</div>

Hi boys and girls…  
I have a problem when I import a map in unity with Tiled2Unity. The map looks white!!!

This is the problems I have:

```auto
Error creating material 'Overworld.mat'. Texture was not found: Assets/SPRITES/Overworld.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[])

```

And:

```auto
Imported prefab 'Assets/Tiled2Unity/Prefabs/PRUEBA.prefab' from 'Assets/Tiled2Unity/Imported/PRUEBA.tiled2unity.xml' with 0 warnings and 1 errors.
Error creating material 'Overworld.mat'. Texture was not found: Assets/SPRITES/Overworld.png

UnityEngine.Debug:LogError(Object)
Tiled2Unity.ImportBehaviour:ReportPrefabImport(String) (at Assets/Tiled2Unity/Scripts/Runtime/ImportBehaviour.cs:198)
Tiled2Unity.ImportTiled2Unity:PrefabImported(String) (at Assets/Tiled2Unity/Scripts/Editor/ImportTiled2Unity.Prefab.cs:37)
Tiled2Unity.TiledAssetPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Assets/Tiled2Unity/Scripts/Editor/TiledAssetPostProcessor.cs:103)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])

```

 ![Captura de pantalla (139)](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/3/3db13df6534cee8aed44ddb163bde7c9d6e164da.png)

Please I need help…

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [June 29, 2021, 7:24am UTC](https://discourse.mapeditor.org/t/problem-when-i-import-a-map-of-tiled/5177/2 "2021-06-29T07:24:49Z")

</div>

Welcome to the Tiled forum, @Pou!

> [@Pou](#):
>
> Error creating material ‘Overworld.mat’. Texture was not found: Assets/SPRITES/Overworld.png

As can be read in the error message, it’s expecting a texture at “Assets/SPRITES/Overworld.png”, however judging by your screenshot this file is in your project at “Assets/Tiled2Unity/Sprites/Overworld.png”. This mismatch is likely the cause of the texture failing to load and the map looking white.

Note that Tiled2Unity has been deprecated for years now so you’ll probably want to switch to [SuperTiled2Unity](https://seanba.itch.io/supertiled2unity) at some point. I noticed you’re also using a very old version of Unity though, which would need to be updated at the same time.

---

<div class="post-metadata">

**Author:** ![Pou](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@Pou](https://discourse.mapeditor.org/u/Pou)\
**Post date:** [June 29, 2021, 8:44am UTC](https://discourse.mapeditor.org/t/problem-when-i-import-a-map-of-tiled/5177/3 "2021-06-29T08:44:52Z")

</div>

Thank you very much for answering, I have tried with SuperTiled2Unity as you told me and I have downloaded the latest version of unity. But I have some questions:

- When I save the map that I made in tiled, I only see the tmx file, I need to know how to get the tsx and png file. I have informed myself a little to know more or less how it is done and from what I have seen in the videos they say that you have to put the tmx, tsx and png files but at no time does it explain how they are achieved.  
Sorry if my English is not very good, I am Spanish.

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [June 29, 2021, 9:13am UTC](https://discourse.mapeditor.org/t/problem-when-i-import-a-map-of-tiled/5177/4 "2021-06-29T09:13:24Z")

</div>

The png file, tsx file and tmx file all need to be in your Unity assets folder. The easiest way to set things up is create those files there in the first place, which avoids any potential problems with relative paths when moving the files into the assets folder.

So your workflow should basically be as follows:

- Copy any png files you’d like to use to your Unity Assets folder.
- In Tiled, create a new tileset based on the png file from your Assets folder, and save it as a tsx file in the Assets folder.
- In Tiled, create a new map and save it as a tmx file in the Assets folder.
- You should see SuperTiled2Unity automatically generate the relevant Unity assets, which you can drag into your scene. When you place some tiles on the map and save it again, its related asset should get updated automatically.

Of course you can save the png, tsx and tmx files also in any child folders, as long as they’re within your Assets folder.

---

<div class="post-metadata">

**Author:** ![Pou](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@Pou](https://discourse.mapeditor.org/u/Pou)\
**Post date:** [June 29, 2021, 9:33am UTC](https://discourse.mapeditor.org/t/problem-when-i-import-a-map-of-tiled/5177/5 "2021-06-29T09:33:38Z")

</div>

Thank you very much friend, I have been able to fix the error. What I have done has been to add the tmx and png files to the assets folder. Although I don’t understand why it works for me without adding the tsx file.

 ![Captura de pantalla (140)](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/0/07243078eb034ee7d38e46b9871b27f50f228865.png)

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [June 29, 2021, 9:54am UTC](https://discourse.mapeditor.org/t/problem-when-i-import-a-map-of-tiled/5177/6 "2021-06-29T09:54:42Z")

</div>

> [@Pou](#):
>
> Although I don’t understand why it works for me without adding the tsx file.

You might have your tileset definition embedded inside of the map, rather than stored separately. This is an option, though it is recommended to share the tileset definition among your maps.

If this is the case, you can replace the embedded tileset with the external tsx file using the small “Replace Tileset” button at the bottom of the Tilesets view.

---

<div class="post-metadata">

**Author:** ![Pou](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@Pou](https://discourse.mapeditor.org/u/Pou)\
**Post date:** [June 29, 2021, 10:27am UTC](https://discourse.mapeditor.org/t/problem-when-i-import-a-map-of-tiled/5177/7 "2021-06-29T10:27:40Z")

</div>

Thank you very much for everything, I already solved my mistake. I have just one more question, how could I put some cells to grid when making my maps in tiled?

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [June 29, 2021, 11:26am UTC](https://discourse.mapeditor.org/t/problem-when-i-import-a-map-of-tiled/5177/8 "2021-06-29T11:26:23Z")

</div>

Sorry, I don’t understand the question. What does it mean to “put some cells to grid”?

---

<div class="post-metadata">

**Author:** ![Pou](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@Pou](https://discourse.mapeditor.org/u/Pou)\
**Post date:** [June 29, 2021, 4:36pm UTC](https://discourse.mapeditor.org/t/problem-when-i-import-a-map-of-tiled/5177/9 "2021-06-29T16:36:30Z")

</div>

Nothing, I already solved it. But I have a question about unity. I already made the map with tiled and imported it to unity with tiled2unity but my question is not about tiled, is about unity. I need to know how to enlarge the camera so that it occupies the entire map.

 ![Captura de pantalla (141)](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/9/9c064356e61c182e1f5963372591703de95051ab.png)

this is the map that I created with tiled and i imported but as you can see the camera does not occupy the entire map and I don’t know how to fix it.

What happens is that if I enlarge the camera down so that it occupies the entire map, it stays that way.

 ![Captura de pantalla (142)](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/2X/7/7e785cab7b4b4da6fab54972ea662e728b589650.png)

I do not know what I can do.

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [June 29, 2021, 7:52pm UTC](https://discourse.mapeditor.org/t/problem-when-i-import-a-map-of-tiled/5177/10 "2021-06-29T19:52:17Z")

</div>

Sorry, I can’t really help with the Unity side of things.
