I'm trying to get the children of a node and its returning the error message:
"Attempt to call function get_children in base 'null instance' on null instance"
The node path is correct and I copied the path directly from node so it doesn't seem like there is a mistake with that.
Here is the code:
for inv_slot in $InventorySlots.get_children():
inv_slot.connect("gui_input", self, "slot_gui_input", [inv_slot])
And the scene tree looks like this(I don't know how to upload photos):
Inventory -> InventorySlots -> Slots 1-25
(The script is attached to the "Inventory" Node)
Is there anyway to fix this?