Scene¶
load_scene ¶
load_scene(path: str) -> None
Load a scene from a res:// path, replacing the current live scene.
Example
load_scene('res://levels/level_2.fscene')
add_scene ¶
add_scene(path: str, parent: Object = None) -> Object
Load a scene from a res:// path and add it as a child of parent (or as a root-level object if parent is None). Returns the newly created root Object of the loaded scene.
Example
enemy = add_scene('res://enemy.fscene', self.owner)
enemy.get_component(TransformComponent).world_position = spawn_point