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