I'm trying to create a method that I call between my splash and main menu to instantiate and record all spawn positions from my levels. I'm getting an
!is_inside_tree() error, likely since I'm trying to iterate over children directly after adding the node to my tree.
for path in stage_paths:
# instance level to get spawnpoint
var stage_path = path
var temp_level = preloaded_level_dict[stage_path].instance()
var canvas_layer = CanvasLayer.new()
canvas_layer.layer = -9999
for child in temp_level.get_children():
if child.name == "SpawnPoint":
point = child.global_position
Any way around this? In short, I want to instantiate, iterate over, then free super quickly.
I tried embedding the iteration over children into a separate method that I use a
call_deferred() to call, but no luck.