Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

As per GM manual, layer_get_tilemap does not work for anything created at runtime, which includes GMLive. I was at one point told that this will be addressed in 2.3, but that has not happened just yet.

A workaround would be like:

function layer_tilemap_get_id_fixed(_layer) {
    var els = layer_get_all_elements(_layer);
    var n = array_length_1d(els);
    for (var i = 0; i < n; i++) {
        var el = els[i];
        if (layer_get_element_type(el) == layerelementtype_tilemap) {
        	return el;
        }
    }
    return -1;
}

Ah sorry for wasting your time, I completely missed that! Thank you!