Confused about tilemaps and tilemap layers

Godot Version

4.3

Question

Hi, I’m new to godot and recently started out with godot 4.3 and I’m a bit confused about the tilemap and tilemap layers.
For context I’m trying out astargrid2d and having it do pathing for me based on my tilemap layer and I currently have this in a script for the player.

But I’m thinking I’ll likely want to separate the astargrid from that script into its own to allow other scripts to make use of the pathing without re-creating the grid in every script that needs it.
(Well who knows but I want to play around with it.)

So back to the issue.
According to godot 4.3, as soon as I create a tilemap the engine gives a warning that tilemaps are deprecated and multiple tilemap layers should be used instead.
So I’m not sure how people manage their tilemap layers, I would have expected to place (multiple?) tilemap layers inside the tilemap and have it act as a kind of folder with possibly some useful inheritence properties for the scripts or such, but even if I place layers inside the tilemap it still gives the same warning saying it is deprecated.

Taking the astargrid2d as an example here, it would in this case make more sense to me to attach the script to the tilemap and have all the layers inside of that tilemap and inherit the script kind of.
Where else would I place the astargrid2d script, even if I place it in a layer, wouldnt it get weird when I add more layers and they dont have the script?

So should I just ignore the warning in godot and use the tilemap as a folder for the layers or how would you guys go about this?

Regards, a pleb.

You can use a Node2D as a sort of “folder” for the layers. TileMap was just deprecated in 4.3 in favor of separate nodes (TileMapLayer) for separate layers of a tilemap.

If you are only looking to navigate the tilemap layers it may be better to use the navigation agent and navigation map nodes.

Thanks for the reply :slight_smile:
I’ll look into the navigation stuff you mentioned or give the node2d folder idea a try otherwise, appreciated!