Switch scenes issue

I reproduced your code locally. Check the bottom of the Editor while it’s running, look at the Debugger Errors, you’ll see a couple! I haven’t personally messed with scenes, but it looks like there’s some issues relating to switching scenes and perhaps which is your main scene (because when I made 2 my main scene, I saw the same behavior but couldn’t switch back off of 2).

E 0:00:02:0518   _parse_ext_resource: res://Levels/level_1.tscn:7 - Parse Error: [ext_resource] referenced non-existent resource at: res://scene1.gd
  <C++ Source>   scene/resources/resource_format_text.cpp:163 @ _parse_ext_resource()
E 0:00:02:0525   set_path: Another resource is loaded from path 'res://Levels/level_1.tscn' (possible cyclic resource inclusion).
  <C++ Error>    Method/function failed.
  <C++ Source>   core/io/resource.cpp:75 @ set_path()

Edit: Looks like it is a cyclic dependency. One way to fix it seems to be to use load here instead of preload.

1 Like