I was trying to make portals between scenes without needing to make a separate Area2D for every scene. I am getting an error message:
:E 0:00:03.568 load: Resource file not found: res://.
<C++ Error> Condition "!filecheck->fileexists(ppath)" is true. Returned: RES()
<C++ Source> core/io/resourceloader.cpp:283 @ _load()
Area2D.gd:12 @ _physicsprocess()
it's weird because I realized the script works perfectly fine in the second scene.
On the other hand on the first scene, I get the variable isn't created and I get the error message.
here's the code:
extends Area2D
var next_world
export(String, FILE,"*.tscn") var next_world
func physicsprocess(delta):
var bodies = getoverlappingbodies()
for body in bodies:
if body.name == "gamer":
print(nextworld)
gettree().changescene(nextworld)