-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Godot 4.2 is unable to preload resources that DO exist. #85809
Comments
The error message is really cryptic and unhelpful. It seems the issue is due to a loading cycle. On extends Node2D
# Called when the node enters the scene tree for the first time.
func _ready():
var baller = preload("res://base.tscn")
add_child(baller) If you comment/remove that
Did you upgrade from any 4.x version, or earlier from 3.x? |
im sorry im not really sure what details i need to provide.
well im a dumbass, the code is incorrect.
ill... try that... |
I meant that the error Godot gives is not clear; it wasn't about your report 🙂 I don't know if your scenario is supposed to work or not, but since you mentioned that it has happened since you ported this code to 4.2, this might be a regression. What was the previous Godot version you were using? |
the project is only from 4.1, but i only got errors when i upgraded to 4.2, incidentally. sometimes godot will say the scenes are corrupted when i try to open them for some reason |
Hi. I've got the same issue on v4.2.stable.official [46dc277] With the "preload" line, an error raises when Godot starting. Line 140 of "bug.tscn" references the "bug.gd" script. If I comment the line, error message disappear. |
Changing |
Using the MRP, I have found that you are preloading from the variable name i think you just wants to add the other scene Update the func _ready():
var baller = preload("res://ball.tscn").instantiate()
add_child(baller) If I'm wrong and you want to preload the same scene inside itself, then you can try other methods like Edit: Using I'm thinking if this should be considered as an issue, peloading Scene(A) which is using Script(A) inside Script(A) and adding it as a child to Scene(A), it will be an infinity loop. Maybe the compiler should raise an error when preloading a scene which is using the same script or preloading the same script inside itself, to prevent crashing the editor when using tool scripts. |
Tested versions
This issue did not occur before i upgraded to 4.2.
System information
Linux Mint on GD 4.2 stable
Issue description
When attempting to instantiate a scene through code, you first have to preload it, but for some reason godot is saying that it does not exist:
Steps to reproduce
Download the project, open it, and debug run it.
Minimal reproduction project (MRP)
project.zip
The text was updated successfully, but these errors were encountered: