# Instance scene asynchronously and add to current scenevartarget=get_tree().get_current_scene()
varscene_file:="res://examples/Animals/Puma.tscn"varpos:=Vector3(0, 1, 0)
SceneLoader.load_scene_async(target, scene_file, pos, true)
How to load child scene async with callback
# Instance scene asynchronously and send to callbackvartarget=get_tree().get_current_scene()
varscene_file:="res://examples/Animals/Puma.tscn"varpos:=Vector3(0, 1, 0)
SceneLoader.load_scene_async_with_cb(target, scene_file, pos, true, funcref(self, "on_animal_loaded"), {})
funcon_animal_loaded(path : String, instance : Node, pos : Vector3, is_pos_global : bool, data : Dictionary) ->void:
vartarget=get_tree().get_current_scene()
instance.transform.origin=postarget.add_child(instance)
How to load child scene sync
# Instance scene synchronously and add to target scenevarscene_file:="res://examples/Animals/Puma.tscn"vartarget=get_tree().get_current_scene()
varinstance:=SceneLoader.load_scene_sync(target, scene_file)