I’m pulling out my hairs already. I just found out that sprite origin is exact middle instead of pixel corner and that makes it harder to get the precise position. I tried a function like this, at first, it kinda worked.
--Get Tile ID from tilesource function tile_id(inst, x, y) local tile = tilemap.get_tile(inst.SOLIDMAP, inst.SOLIDLAYER, math.ceil(x/TILE_SIZE), math.ceil(y/TILE_SIZE)) return tile end