I want to create an inventory item dragging system but to do that I first must make it draggable. I would have the player hold their mouse button and the GUI image is stuck to the mouse cursor until the client lets go of it.
Now for the problem I described in the title, I want to detect where it's located so that if I drag the item to an empty item slot, the script knows which slot it should be placed in. If I drag it to a hotbar slot, the script will know where to place so item in that slot while emptying its prior slot it was dragged from.
I however have no clue how to do something like that and the closest thing I know to such is Region3 but there may be more efficient ideas than comparing it to Region3 but with GUIs.
There is an event designed to detect the mouse's presence in GUI elements called .MouseEnter
.
It can be used on inventory slots in a client script while detecting if the client is already dragging an item.
GuiObject events: https://developer.roblox.com/en-us/api-reference/class/GuiObject