L
Luka Radulovic
Guest
I'm putting in sound effects into my game currently and need a little help. I want to check which tilemap is below an object and based on that play a distinct sound.
For checking which tilemap is below I'm using the tilemap_get_at_pixel function. The first parameter is tilemap_element_id, which as far as I understand is the id of the specified tilemap. In any tutorials that I've seen they access this id with the function layer_tilemap_get_id which gets the tilemap that's set for that specific layer in the room.
In my game, there are rooms that have 2 or more different tilemaps (surfaces) that require different sounds to be played. Each of these tilemaps are in a different layer of course, as I don't see how I'd be able to put them into the same one.
Is there a way to check what tilemap is below an object without having to get the tilemap's id from its layer in the room?
For checking which tilemap is below I'm using the tilemap_get_at_pixel function. The first parameter is tilemap_element_id, which as far as I understand is the id of the specified tilemap. In any tutorials that I've seen they access this id with the function layer_tilemap_get_id which gets the tilemap that's set for that specific layer in the room.
In my game, there are rooms that have 2 or more different tilemaps (surfaces) that require different sounds to be played. Each of these tilemaps are in a different layer of course, as I don't see how I'd be able to put them into the same one.
Is there a way to check what tilemap is below an object without having to get the tilemap's id from its layer in the room?