Does the error display which line the Resource file not found: res://
is on or being triggered by?
My guess would be the change_scene
function call on `` is causing the issue. Maybe add print(scene)
after line 12
in the first code snippet and see what it shows? Maybe it is not loading it currently. I might also suggest adding print(scene)
between lines 2 and 3 in the second code snippet, just to make sure everything is as expected.
Also, what is stored in scene
when you save it to a file? The change_scene
function takes a string that is the path to the scene file you want to load. If you pass a non-string to it, that could also be contributing to the issue.
(Small note: I fixed code format. You can just post the code with a single tab indent or surround it with three ~
on either side)