I'm using Godot for my current project, and it's been going great; but there's a bug I don't understand. I have a certain very simple script on my title screen:
extends Node3D func _input(event): if event.is_action("jump"): get_tree().change_scene_to_packed(preload("res://scene/Level.01.tscn")) That's all of it, and its job is to simply change the scene to the preloaded first stage when the jump key is pressed. It does work.
However, I consistently get an error message, referencing C++ code, when I run my program (even though behavior is fine). It's triggered by this script.
E 0:00:03:0209 Title Screen.gd:6 @ _input(): Parameter "current->parent" is null. <C++ Source> scene/gui/rich_text_label.cpp:3622 @ pop() <Stack Trace> Title Screen.gd:6 @ _input() If I had to guess, I'd say it was arguing that the current node's parent was not set. That actually almost makes sense, as it's on a root node for the title screen. However, I do not understand why changing a scene would require it to be set in the first place. I'm not asking about the parent.
I don't like to leave warnings and errors hanging, even if they don't seem to be causing any problems. Is this a quirk of Godot, or am I looking at an actual error in my code?
Title Screen.gd. Can you provide more information about the code? \$\endgroup\$change_scene_to_packedline, which is usually line six. I can't be sure which part. This script is on a root node, which may have something to do with it; but I don't know why that's necessary for a scene change. It specifically happens after I press jump, so it isn't likely the preload as that would run immediately. It should happen just as readily in other projects. Tomorrow's Halloween, but when I've got time I may try and isolate it. \$\endgroup\$rich_text_label.pop(), maybe it's because you have operated aRichTextLabelincorrectly elsewhere. Now that the error is triggered by thechange_scene_to_packedline, canres://scene/Level.01.tscnbe opened independently in the editor? \$\endgroup\$