Where should I be storing GUIs for plugins?


I’m creating a plugin that shows you the size of your part when selecting it but for some reason if I place my BillboardGui under anywhere but CoreGui the gui gets destroyed when using undo to remove a new part as I’m selecting it. I believe that ChangeHistoryService is deleting my BillboardGui that I created with the plugin but I don’t want that service to mess with it at all (it’s automatically adding a waypoint when I create it, thus undoing is destroying it). I couldn’t find any way to temporarily pause ChangeHistoryService from creating waypoints that didn’t completely wipe the waypoint history.

The only solution I found was to put it under CoreGui (the same place where the Lua Draggers attachments are stored) - where ChangeHistoryService isn’t affecting my gui. Is this considered good practice? Is there any other place I should be putting temporary visual stuff for my plugins at?

Thank you.

As long as there’s a reference to an Instance, setting its parent to nil doesn’t make it get GC’ed. I usually make my plugins a Folder with a “main” script and other needed resources. Or you could just disable the GUI when it’s not supposed to be shown.

But no, using CoreGui as a temporary storage location isn’t a bad idea IMO. Most developers probably have it disabled in the Explorer pane anyway (by default IIRC), and I’ve been used to CoreGui being a mess of various plugins keeping stuff around anyway so I don’t think it’s harmful.

For reference here's what my CoreGui looks like ATM:


and the plugins I use:

1 Like