How'd I initiate drag and drop from Explorer to Plugin widget?

So Plugins can utilize drag-and-drop functionality, but how’d I do it with objects from the Explorer?

I’ve tried looking for some sort of “MouseButton1Down” for the explorer, but I haven’t found anything like that. I can use SelectionService:Get() to get what’s being dragged, but I can’t figure out when it’s being dragged.

2021-06-18_17-08-51

Even with the following code

dragTargetWidget.PluginDragEntered:connect(function (dragData)
	print("PluginDragEntered")
end)

dragTargetWidget.PluginDragLeft:connect(function (dragData)
	print("PluginDragLeft")
end)

dragTargetWidget.PluginDragMoved:connect(function (dragData)
	print("PluginDragMoved")
end)

Nothing is printed when an object from the explorer is dragged inside the widget

2 Likes

⠀⠀⠀⠀
⠀⠀⠀⠀⠀Currently, there is no way to do it, I have tried countless times to achieve this, but sadly nothing worked. I thought “PluginMouse.DragEnter” did this exact thing, but it doesn’t do what I thought it did. This feature would be very beneficial to those who are implementing Instances in their plugin. I would like to see support for both DockWidgetPluginGuis and CoreGui ui, because right now dragging an explorer instance to each does nothing.

ezgif-2-3ae56fbd7ff8 ezgif-2-cfa7b774551e

Utilizing SelectionService for events like this would be more resourceful, as it only has 4 unique methods and 1 event. (:Add, :Get, :Remove, :Set, and .SelectionChanged) Additionally, SelectionService’s only functionality at this moment is for objects being selected, not necessarily for the explorer. A “Dragged” event will be awesome, though plugins don’t get very much attention, I’d say this feature will make plugin building just a little easier.

Also, there was a feature requst posted less than a year ago:
Support Explorer object drags into plugins

2 Likes