Hello. i have been trying to set up a level loading system that does not switch scenes.
in each level there is light2D's and a canvas modulate along other things.
when i instantiate a level and add it to main as a child it loads, but for some reason the CanvasModulate is not doing anything.
here is my loader code:
func load_level(file : String):
var new_level = load(file)
var level = new_level.instance()
level.name = "level"
if $"/root/Main/".has_node("level"):
var old_level = $"/root/Main/level"
for child in old_level.get_children():
child.queue_free()
old_level.replace_by(level)
old_level.queue_free()
$"/root/Main".add_child(level)
this code runs in a singleton.
any idea how to fix the issue/ how to implement non whole scenetree levels?