Failed to Load Scene

Hello

I’ve faced an error while working on my Godot Engine project. Whenever I attempt to instantiate scene instances dynamically using code, I receive the following error message: Failed to Load Scene: path_to_scene . I’ve checked the scene paths and ensured that all necessary files are present, but the issue still exist.

I have checked General - Godot Forum .
Has anyone else faced a similar error when instantiating scene instances programmatically in Godot Engine? If yes , could you please share any help that might help resolve this issue?

Any help would be greatly appreciated.

Thank you
gregbowers

Hello, if you share the code where you instantiate the scenes and your folder structure it would be helpful to detect the problem more easily.

Thank you for your response and willingness to help.

here’s a simplified version of the code where I attempt to instantiate scenes:

var scene = load(“res://Scenes/Scene1.tscn”)
var instance = scene.instance()
add_child(instance)

In this code snippet, I’m trying to load and instantiate ‘Scene1.tscn’ dynamically. However, I receive the error message ‘Failed to Load Scene’ when running the project.

If you have any suggestions based on this information, I would greatly appreciate it.

Thank you once again for your help.

As far as I know the method .instance does not exist but instead PackedScene — Godot Engine (stable) documentation in English