tile highlighting

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Keil

Hi,
i have a 3D world made of tiles (meshInstance), just like an isometric game.
When cursor is over a tile, i want to highlight the surface of the tile.

I try set_material_override, but the whole tile is highlighted, i want only its surface to be highlighted.

how can i do that ?

:bust_in_silhouette: Reply From: Fgico

You could try editing the tiles to have the part you want to higlight as a separate surface and then you can access and change its material with:
meshInstance.mesh.surface_get_material(surface_index)
meshInstance.mesh.surface_set_material(surface_index, newMaterial)