Godot Version
4.3-stable
Question
I recently made an inventory system for a project I’m working on. I wanted to make a copy of the system for use as a seperate inventory for a container you can open. (i.e. a crate or barrel with goodies inside.) This works when I haven’t messed with the child/parent structure of the system. The reason I changed it around is due to being unable to properly anchor the ui elements to the top right corner of the screen. The problem I’ve run into is the copy of my inventory is trying to reference nodes from the original despite me renaming and re-referencing nodes in the copy.
CODE:
class_name ContainerInventory
extends Node2D
@onready var slot_scene = preload("res://Inventory/slot.tscn")
@onready var grid_container = $"../loot_MarginContainer/VBoxContainer/ScrollContainer/GridContainer"
@onready var item_scene = preload("res://Inventory/item.tscn")
@onready var scroll_container = $"../loot_MarginContainer/VBoxContainer/ScrollContainer"
@onready var col_count = grid_container.Columns
. . .
Any advice would be appreciated.