Making an inventory

Trying to get my items into my inventory widget. The script runs when i interact with the item, and destroys it as it should without any issues, but it doesnt make any changes to the inventory slots. I think that this function is where the issue is but its hard to tell (yes ive debugged a bunch of areas).

The tutorials ive been referencing have stackable items, but i dont want that so ive been omitting certain steps and now im lost </3





Are the elements not displayed in the user interface or are they not added to the array of elements?

I think we should compare the name of the item first, and only then do the other conditions.