Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | FilipKench |
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 “!file_check->file_exists(p_path)” is true. Returned: RES()
<C++ Source> core/io/resource_loader.cpp:283 @ _load()
Area2D.gd:12 @ _physics_process()
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 _physics_process(delta):
var bodies = get_overlapping_bodies()
for body in bodies:
if body.name == “gamer”:
print(next_world)
get_tree().change_scene(next_world)