I have set up an inventory container for my player and a menu screen using the inventory container (slots) menu part. It appears as follows:
My goal is to be able to rearrange the items in the inventory as shown in the inventory container documentation. In the menu screen part I have enabled the various settings involving drag and drop, including the merge on drop checkbox (I tried different combinations of settings) but in general I guess it looks like this:
I have also gone through inventory settings an enabled dragging although I don't think it actually pertains to the inventory containers slots.
As a test I enabled the drag notification in the UI settings to see if it was registering the drag and it seems to be doing so as the UI Box I setup to appear on drag does appear and disappear; however, dragging any one slot does not do anything no matter where I let go of the dragged slot.
I noticed the inputs for the menu part are UIButtonInputs and not HUD Component Content provided UI shortcuts and I am wondering if this has anything to do with it.
I also wonder if there is a default item slot sorting setting that is preventing me from rearranging slots and sorts the items into the first available slot preventing me from rearranging, but I have had no luck finding such a setting.
I appreciate any help I can get on this matter, thanks for your time!
And in my inventory menu screen on the inventory container menu part I have changed the assigned slot content layout to be a shortcut UI hud type.
The inventory still displays as in my first picture so the shortcut slot is populating with the item and displaying the icon properly. However I am still having no luck with drag and drop functionality
Unity either silently changed how the Unity UI handles pointer events or has a bug since Unity 2021.2 (or maybe even earlier). Basically, pointer enter on a child object will now cause pointer exit on it's parents, e.g. moving the cursor over an image on a shortcut slot child object will no longer recognize the shortcut slot as being hovered over, breaking everything here ...
Next ORK update will add a fix/workaround for this.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I have fixed the issue thanks to this forum post here: https://forum.unity.com/threads/problem-with-ipointerenterhandler-ipointerexithandler-and-setactive.1235596/
The post that details the fix, explains the following:
So to fix this issue I simply went into C:\Program Files\Unity\Hub\Editor\2021.3.1f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\InputModules
and edited the BaseInputModule.cs file to comment out those 4 lines mentioned in the post. Now I can drag and drop items and rearrange them just fine.
Hopefully this helps anyone while they are waiting for a work around from GIL or fix from Unity itself (unlikely probably)