I'm trying to make some sort of basic item pickup system but I'm not sure how to approach the way I want it to work.
I have a VBoxContainer full of instanced scenes (which are just labels with scripts), each label is assigned a certain item on instancing (selected from item group) and when I click on the label I want it to tell me the exact index that item is in, in the item group.
Every item a label gets assigned it is from an array in my Interaction script (the item group), right now I'm just doing
items.find(item) (items being the item group) but if I have multiple of the same items like 2 apples then it will return the first apple it finds, not the one that is assigned to the label
Items array has 3 apples, they are each assigned to 3 labels I click on the third label and search for the item assigned to it using
items.find(item) and .find returns the first apple I want it to return the index of the label I selected.
How would I go about getting the correct item?