im trying to get this to work
var slot = get_tree().root.get_node("/root/World/YSort/Character/Player/UserInterface/Inventory/GridContainer/Slot" + str(slot_index + 1))
if slot.item != null:
slot.item.set_item(item_name, new_quantity)
else:
slot.initialize_item(item_name, new_quantity)
with the var slot path it wont go into the Game Node from the root of where PlayerInventory.gd is
and i get this error
E 0:01:04.369 get_node: (Node not found: "/root/World/YSort/Character/Player/UserInterface/Inventory/GridContainer/Slot1" (absolute path attempted from "/root").)
<C++ Error> Condition "!node" is true. Returned: nullptr
<C++ Source> scene/main/node.cpp:1322 @ get_node()
<Stack Trace> PlayerInventory.gd:42 @ update_slot_visual()
PlayerInventory.gd:38 @ add_item()
ItemDrop.gd:18 @ _physics_process()