Quick answer: Call tag_get_assets("enemy") after Game Start. Verify the tag exists on each asset in IDE inspector. Filter by asset_get_type if you need a single asset class.

A spawner uses tags to randomly pick an enemy: tag_get_assets(“enemy”) returns empty array. Tags exist in the IDE but runtime can’t find them. Misspelled tag or missing index build.

Tag Lookup

var enemies = tag_get_assets("enemy");
show_debug_message(array_length(enemies));   // 0 means none found

If 0, problems are: tag misspelled, asset doesn’t have it set, or asset wasn’t indexed in build.

Verify Tag in IDE

Open the asset in IDE. Bottom-right: Tags field. Comma-separated. Confirm exact spelling matches your tag_get_assets call. Tags are case-sensitive.

Filter by Asset Type

var all = tag_get_assets("enemy");
var objects = [];
for (var i = 0; i < array_length(all); i++) {
    if (asset_get_type(object_get_name(all[i])) == asset_object) {
        array_push(objects, all[i]);
    }
}

tag_get_assets returns IDs of any asset type. Filter to objects (or sprites, sounds) as needed.

Use in Spawner

var enemies = tag_get_assets("enemy");
if (array_length(enemies) > 0) {
    var picked = enemies[irandom(array_length(enemies) - 1)];
    instance_create_layer(x, y, layer, picked);
}

Random pick from tag pool. Add new enemy objects with the tag — spawner picks them up automatically.

Tags vs Group Folders

Group folders are organizational; not queryable at runtime. Tags are. For runtime grouping, always use tags.

Verifying

Spawn 100 enemies via the tag pool. All defined enemy types appear (visually verify). Add a new enemy with the tag; without code changes, it appears in subsequent spawns.

“Tags are runtime metadata. Spell carefully, check the IDE field, filter by type as needed.”

For data-driven design (adding content without code), tags + tag_get_assets are GameMaker’s closest equivalent to Unreal’s GameplayTag system.