Multiple cannot create tile errors

Hello, I’m working on a game Project in Godot 4.5, and I’m trying to use the TileMap Layer.

For a level 1 scene, I’ve made a TileMap that uses several tilesets of different tiles (which represent either walkables tiles or obstacles).

But each time I open the project, or I run the level 1 scene, I got around 474 errors related to the tilests. Something like:

ERROR: Cannot create tile. The tile is outside the texture or tiles are already present in the space the tile would cover.
ERROR: The TileSetAtlasSource atlas has no tile at (27, 5).
ERROR: TileSetAtlasSource has no tile at (27, 5).

I tried to look for a solution: I even found out in the tileset that I need to click “Remove Tiles Outside the Texture” for each tileset where there was a yellow warning. This is what I did, but the errors are still happening.

I don’t really know what to do, so I would like more explanation:

  • How do I identify which TileSet and source a painted tile in my level TileMap belongs to?

  • Do I have to delete all my tileset from the project and re-add them again properly ? I think I have some tileset I’m not using.

For now, it does not prevent me to play the game, but I would like to solve all these errors if possible. And I believe if I know from which tileset exactly the errors refer to, I might be able to solve part of the problem.

Thanks in advance.

Hi, can you clarify what nodes you are using? Are you using TileMapLayer or TileMap? And how many nodes do you have?

Well, I’m using the recent TileMapLayer, where all of it’s children are animated sprites that correspond to the playable units and the enemies units.

Here is my main architecture so far.

SampleTileMap2
|
–>TileMapLayer
|–>PlayerUnit1
|–>PlayerUnit2
|–>PlayerUnit3
|–>EnemyUnit1
|–>EnemyUnit2
|–>EnemyUnit3
|
–>Turn_system
|
–>Enemy_AI
|
–>CanvasLayer
|
–>Camera2D
|
–>Music Player
|
–>SFX Player
|
–>WinCondition
|
–>CameraBounds
|
–>Global_Pathfinding

As I said before, it happens when I open the project and when I run the level scene. For the former, it’s possible a script has a reference to the tileMap/Tileset resources that haven’t been set up yet, and it can lead to the errors.

I’m not sure what to do, if I have to delete the existing tilesets and start from fresh. But even if I delete all tilesets, will my tileMap using the tiles become empty ?