-
Notifications
You must be signed in to change notification settings - Fork 65
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
PackedScene with missing file causes crash when set in an Export #398
Comments
What version of Godot are you using? I can't reproduce this issue on 4.2.1 release. Godot does not let me open a scene with missing dependencies and provides a proper dialog window for fixing them. |
I am using 4.2.1 but I think you missed my description. The PackedScene is set onto an @export of my custom SwiftGodot class. It's not in the node tree of the scene. |
I think that's what I was trying to do. I have a trivial SwiftGodot class with PackedScene export: @Godot
final class SomeScene: Node {
@Export
var otherScene: PackedScene?
} and its scene file
If I delete
and present a dialog allowing to fix missing dependencies. |
What if you load your game with that scene in the main file
… On Feb 19, 2024, at 12:42 PM, Mikhail Tishin ***@***.***> wrote:
I think that's what I was trying to do. I have a trivial SwiftGodot class with PackedScene export:
@godot
final class SomeScene: Node {
@export
var otherScene: PackedScene?
}
and its scene file Scene.tscn:
[gd_scene load_steps=2 format=3 uid="uid://hmmqvij3if3d"]
[ext_resource type="PackedScene" uid="uid://cvyspe7pi4ooy" path="res://OtherScene.tscn" id="1_kkivn"]
[node name="Node2D" type="SomeScene"]
otherScene = ExtResource("1_kkivn")
If I delete OtherScene.tscn and restart Godot, it will throw some errors in the console:
scene/resources/resource_format_text.cpp:448 - res://Scene.tscn:3 - ext_resource, invalid UID: uid://cvyspe7pi4ooy - using text path instead: res://OtherScene.tscn
Cannot open file 'res://OtherScene.tscn'.
Failed loading resource: res://OtherScene.tscn. Make sure resources have been imported by opening the project in the editor at least once.
scene/resources/resource_format_text.cpp:284 - res://Scene.tscn:6 - Parse Error:
Failed loading resource: res://Scene.tscn. Make sure resources have been imported by opening the project in the editor at least once.
editor/editor_data.cpp:626 - Index p_idx = 1 is out of bounds (edited_scene.size() = 1).
and present a dialog allowing to fix missing dependencies.
—
Reply to this email directly, view it on GitHub <#398 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AALK4P2BKHHBS53H3MN6G3DYUO2K3AVCNFSM6AAAAABDLEKKNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJTGEZTKNJUHA>.
You are receiving this because you authored the thread.
|
Same errors, no crash:
|
@Export var packedScene: PackedScene?
What happens:
Godot crashes with the information at the bottom of this
Expected to happen:
I would expect an PackedScene that has been initialized with a invalid path to ultimately end up returning nil or otherwise being initialized but broken.
The text was updated successfully, but these errors were encountered: