I agree with your debugging stance - I’ve had to deal with it as the vendor for many years.
Regarding the assignments - also yes. It never occurred to me that the path would not be correct. I’ve only used ctrl-drag/drop for my @onready vars. But this is also my first Godot project and I’m still acclimating to the coding rules.
Nevertheless, I now have another thing to check when there’s an error.
It would have been nice to get a better error message from the start. The later messages were more informative when they mentioned the path.
Well, I spoke too soon - the problem is not resolved.
I was continuing some work and then had the same Error that started this thread.
Needless to say I was not pleased.
I did some testing and here are the results:
# The short (no full path) slot_grid onready below works everywhere if InventoryMain node is 'editable children'
# If InventoryMain is not 'editable children' then fails in func add_item_to_slot
@onready var slot_grid: GridContainer = $VBoxContainer/ScrollContainer/SlotGrid
# This fails in build_slots if InventoryMain is 'editable children' or not
#@onready var slot_grid: GridContainer = $"/root/InventoryMain/InventoryGrid/VBoxContainer/ScrollContainer/SlotGrid"
# Won't work if InventoryMain is NOT 'editable children' with either onready
FYI - I also tried doing this, but it made no difference:
This is really driving me crazy.
Why would a reference to a node in an Instantiated scene fail to be reachable if the node is not in ‘editable children’ mode?
It seems like accessing a ‘collapsed’ instantiated scene node should be normal behavior.
You can’t. You need to host is elsewhere and post the link.
However, it’d be better to replicate it by minimal means in a fresh project. It’s much easier for people to help you when the problem is isolated, and the process of doing so may reveal to you where the problem actually is.
Does your global scene have any nodes? Did you add the script .gd as a global or the scene .tscn? If you only added the script, then it will not have any children.