Drag and Drop Inventory Items

So incase you look back at this i found a soulution to why its making copies. turns out when i run the foreachloop of course it does it for as many items there are in the array so it was making 70 items so i put in a do once and it makes one and i can drag that one around all day. but then i cant pick up any more items. i assume its because i plugged in a do once node

Its weird that your Inventory structure contains references where does it reference i assume the problem comes from there. And well I also think the do once does not fix the problem it more “hides” it… If an item is created or not should be determinated by the inventory structure being valid or not.

The problem is that you had me run a ForEachLoop based on the number of inventory slots so of course it makes 60 items on top of each other. ive been playing around with this for awhile now and ive more or less got it to work the way i want it to at this point. even though im sure that what ive done is pretty god ■■■■ backwards. so now when i pick up an item it adds the time widget with all of the proper information in it. and it only adds one item to the slot instead of 60. it also drags and drops back and forth and doesnt come up with the same info multiple times. before when it would add an item it would set the items slot based on the array index of the ForEachLoop. so when id move array 4 to lets say slot 20 the item would stay at the index 4 and then the new item would also be index for so those to items would be the same.
basically my solution to alot of this lied in the inventory array because thats where the the info is mostly stored so what happens now On Drop it sets the Items index to the slot im dragging it to so if it was in slot 4 and i dragged it to slot 20 it would change that items index from 4 to 20. the problem however is that instead of doing that it changes it to index -1 however it works anyways so im ok with that.
The item info for the inventory structure is in the item i pick up and is added to an “Inventory Array” of item structures. and thats whats referenced in the UI.

There are still a few problems that need fixing the items are still stretched to hell when i parent them and im very unclear as to why, if i drag an item over another item it would cover it so to fix that i just added a branch if it the slot had children dont do the drop. i would like is to just flip flop the items, but when i tried making something like that it didnt work. and finally when i drag the item the drag image appears then i drop it and were all good, except when i drag it again i dont get a new drag image there just isnt one but when i let go it parents it to the appropriate slot. i think im getting the hang of this but there still alot im confused on. at this point im almost certain im doing most of this wrong but if it works and i dont have to rebuild it then i think all be alright.

The reason it was making extra widgets is cause it was creating widgets based on a “ForEachLoop” so i made it a FEL with break and broke it after the first loop and made sure it only added an item to the slot if there wsnt already an item there if not move to the next slot atleast thats what it looks like. Its getting to a point were im happy with it but it almost feels like i dont need to do it this way, or maybe theres a better way it seems like things are just wrong here. i can move items around and they maintain their info, how ever after removing Item slot 1 lets say when i have 6 items causes the next item i pick up to copy what ever was in slot 1 then all the new items lag behind that. if you can help me figure out these last few problems i should be golden. Right now like i said i get that problem where some times items i pick up lag behind what im actually picking up i believe this is because of how i set up changing the Array. When i drag an item i remove the info from the array then add it back in. if i dont do that, and i have 3 items lets say in the bag, when i move item 2 then pick up a new item it goes to Slot 2 which was empty like it should but it uses the same info so my idea what when i drag remove the element for the array then when i drop add it back in. doing this makes it work properly except like i said it in some situations it causes problems. next is that i cant figure out why the item is scaled weird when i pick it up. and third is that after i drag and drop once then drag a second time it doesn’t make the drag visual. im sure all of this makes no sense but ill link pictures. also why is it weird that my inventory strut has ref.