How to access instances of a TileMap Scene Collection?

Godot Version

4.3.stable

Question

I’m experimenting with the Scene Collection feature of the TileMapLayer node and want to use it to define enemy spawn points.
My problem is that I can’t find a way to access the instances of the Scene Collection.

I’ve tried using TileData and groups but it doesn’t work. What can I do instead?

@onready var _enemy_spawner_tile_map_layer: TileMapLayer = $EnemySpawnerTileMapLayer

func _ready() -> void:
	for used_cell: Vector2i in _enemy_spawner_tile_map_layer.get_used_cells():
		var tile_data := _enemy_spawner_tile_map_layer.get_cell_tile_data(used_cell) as TileData
		# is never true
		if not tile_data == null:
			breakpoint
func _ready() -> void:
	var enemy_spawn_markers := get_tree().get_nodes_in_group("enemy_spawn_marker")

	# also never true
	if not enemy_spawn_markers.is_empty():
		breakpoint

I assumed that for each tile with defined SceneCollection, that an object of type TileSetScenesCollectionSource is created.
Could you check the Remote tab of when the game is running? Is there a data object inside your SceneTree that could be your TileSetScenesCollectionSource.
If you knew the tile coordinates, you could also get the TileSetSource directly.

As I haven’t worked with the TileMapLayer yet, I could only reference the documentation:

1 Like

Checking the remote tab was a great idea! Thanks.