You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Godot v4.2.1.stable - macOS 14.2.0 - Vulkan (Forward+) - integrated Apple M2 Max - Apple M2 Max (12 Threads)
Issue description
This is likely the same issue as above, but an even simpler reproduction. The scene fails to load if it contains an attached script that preloads the scene.
Steps to reproduce
Create a project that contains the main scene, main.tscn, with a single Node called Main. Attached to this node is a script, main.gd, with the following contents:
extendsNode# Comment this line and reload project to uncorrupt scene# Uncomment this line and reload project to corrupt sceneconstScene=preload("main.tscn")
Save the scene and script and then reload the project. Upon reload, the following errors are shown in the Output window:
scene/resources/resource_format_text.cpp:284 - res://main.tscn:6 - Parse Error:
Failed loading resource: res://main.tscn. Make sure resources have been imported by opening the project in the editor at least once.
Failed to instantiate scene state of "res://main.tscn", node count is 0. Make sure the PackedScene resource is valid.
editor/editor_data.cpp:626 - Index p_idx = 1 is out of bounds (edited_scene.size() = 1).
The parsing error references line 6 of the main.tscn file, which is the line that attaches the main.gd script to the Main node. This cyclic dependency between attached script and scene appears to cause the scene to fail to load. Full contents of the main.tscn file is provided below:
Godot version
v4.1.1.stable.official [bd6af8e]
System information
Godot v4.1.1.stable - Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 2060 SUPER (NVIDIA; 31.0.15.3713) - Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (6 Threads)
Issue description
Related with #80877
Preload target scene got corrupted when attached script has reference of preload-caller script
I don't know underneath relations of typed class and preload of scene,
but it causes cyclic reference.
Noticeable things
I think cyclic reference between types doesn't make sense. Even c header can prevent it.
Steps to reproduce
in foo.gd
in bar.gd
in another.gd
in bar.gd
Minimal reproduction project
t.zip
The text was updated successfully, but these errors were encountered: