Hello! I have recently started learning how to make my own roblox plugins and i have come across two ways of displaying GUI: CoreGui and DockWidgetPluginGui.
I had know idea about which one I should use so I decided looking at some of the plugins that I own and found out that almost every single one of them used CoreGui.
It depends on your intentions; if your plugin needs to use the viewport for space or user interaction, then use CoreGui. However, if your plugin doesn’t require the viewport or immediate user interaction, you can use Widgets.
For example, if your plugin allows people to insert items from the catalog into your game, a widget would be better for that, but if your plugin helps developers create their games (i.e lighting, mesh generation, or visualization) then CoreGui is better
Since it’s dealing with content in the viewport directly (and presumably, frequently), it’s just better UX to also include the user interface in the same space for easier access
An example I can think of is the Quick Road plugin:
Althought it’s still in beta, it includes 3 different ui “tabs.” If you were to design this on a widget (or 3 different widgets) it will be become bothersome for the end user because they would likely have to constantly switch out their active windows in order to see the toolset for the plugin.
Having it built into the viewport (CoreGui) gives it better usability since you can access all the tools right then and there
(Example of different widgets you can have overlayed on top of each other)
This is a perfect example as to the type of content that should be in a widget as opposed to CoreGui; I don’t always need to see that my studio session is connected to my rojo session so it shouldn’t be placed in the viewport because the viewport is something I frequently need to use and access, and it’ll just take up space for other things that need it