Detecting tile for different walking sound effects

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


I have several terrains on my game and I want them to have a different walking sfx.
Here’s the problem: I’m working with some layers of TileMaps, so how do I check in which tile is the player?

The way I’m working around it is to check with get_cell each layer, but I wonder if there’s an easier way to do it.


If you really need to pick your sound based on tiles on same coords from multiple tilemaps, I can’t imagine easier solution than foreaching tilemaps, picking tiles in current coords and selecting a sound based on tiles you are walking accross.

You may allways prepare one layer for sounds only (by hand or via a code during tilemap loading), but I doubt it’s going to be easier.

Reloecc | 2020-09-16 09:25