![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Raging_Panda |
Hey Guys,
This is how I was loading a scene in my game in Godot 3.
In Godot 4 this currently gives me the error:
Invalid Call. Nonexistent function ‘instance’ in base ‘PackedScene’
Any idea what has changed in GDscript 2.0 because I use this syntax a lot
var scene
if dummy_mode == true:
scene = load("res://scenes/Dummy_serial_interface.tscn")
else:
scene = load("res://scenes/Serial_interface.tscn")
var scene_instance = scene.instance()
scene_instance.set_name("Serial_interface")
self.add_child(scene_instance)