Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ZimZardoz |
Is it possible to create and add the “_level” instance (in GDScript) in the tree before “Cursor” (which one was instanced with the editor) ?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ZimZardoz |
Is it possible to create and add the “_level” instance (in GDScript) in the tree before “Cursor” (which one was instanced with the editor) ?
Reply From: | SQBX |
First add `level as usual
add_child(_level)
Then after than line of code, write
move_child(_level, 0)
So your code should look something like
func _ready() -> void:
_level = load("res://levels/level1.tscn").instance()
add_child(_level)
move_child(_level, 0)