Using Coordinates to Make Tiles Light Up

Godot Version

4.5

Question

Hi, I'm experimenting with pathfinding and I was wondering if there Is a way to use coordinates to make individual tiles change color for debug purposes.

Overlay an additional debug tile map layer with cells of same size as the original, and toggle flat colored cells in there. Functions to transform from map space to local space and other way around are map_to_local() and local_to_map() respectively. Look at the TileMapLayer class reference for details. The same will work with the old TileMap node as well.

Thank You.

Let’s see the implementation.

I’m still working on that. Is there a function I can use to toggle the visibility of individual tiles?

set_cell()
Spend some time with the class reference page I linked above.

I managed to get a working program but It turns the debug tiles invisible instead of the other way around but I can make that work! Thank you for all your help man.

set_cell() can make cells visible or invisible, depending on the arguments you pass when calling it. For details, lookup the method description in TileMap(Layer) class reference.

Thanks. Are you the pathfinding expert on this forum?

1 Like

Is there such a thing as pathfinding expert at all? I’m not sure the Godot expertise can reach this level of granularity :smiley:

2 Likes

The reason I was asking the same question over and over was because I thought they would go to a different person each time and Id get multiple perspectives on my problem.

This is a public forum, not a customer support call center. Everyone can see your question. If you’re not getting adequate response, try to re-formulate the post, be as punctual as possible and provide plenty of information/context.

3 Likes