Instantiating gui elements in CoreGui sometimes causes UIDragDetectors on frames to not work. I have a plugin that creates draggable window in CoreGui, but reloading the plugin sometimes causes UIDragDetector to break and not detecting drag. It works only if I reparent the gui and tweak it with mouse. Could this be caused with absolute sizes not calculating on Gui objects that are not parented?
EDIT: This happens because a ribbon tool is selected. Selecting a ScreenGUI just deselects it, making UIDragDetectors work properly. So this is not really a bug. I’ve also seen a reply under the drag detector post saying that this might get addressed in the future.
Original reply:
I am experiencing a similar issue. UIDragDetectors inside CoreGui do not do anything unless a UI object has been selected inside StarterGui at some point during the session.
In this video you can see me creating a frame with a drag detector inside CoreGUI. It only starts working after I add a ScreenGui inside StarterGui:
Drag detectors inside CoreGui start working if I create a ScreenGui in StarterGui and remove it right away:
Selecting a ScreenGui inside StarterGui is what causes the drag detectors to activate. What’s interesting is that if I try to select using a script, it doesn’t work:
local gui = Instance.new("ScreenGui")
gui.Parent = game.StarterGui
game.Selection:Set({ gui })
Would appreciate if this issue got looked into. I’m using drag detectors in my plugin because they don’t cause any weird reduced re-rendering rate issues that I usually experience with a custom drag implementation when the UI has a Path2D object or some other unknown component, which is the reason I switched to using drag detectors.