Godot Version
4.3.stable
Question
Hi
I’d like to highlight specific tiles in a gridmap dynamically, but can’t find a way to do it.
My first thought was to use a shader and activate/deactivate it at runtime depending on the game logic but I can’t find how to get the shader of a cell, if at all possible.
An idea of the final render can be this from final fantasy tactics advance :
i think for this it would be best to either use a second gridmap or replace the placed tile with a highlighted version of this tile
compare mouse position and map tile like
var tile:Vector2i=map.local_to_map(map.get_local_mouse_position())
then spawn Node2D with desired graphics on tile
oh, thank you, replacing didn’t come in mind, but I think the overlay is a better idea, it will be easier with a diversity of tiles
1 Like