Is there any way to bind a method from a plugin to fire as the client is disconnecting from the session, seeing that a plugin will obviously no longer be loaded into the session after the user is gone?
My plugin creates previews of the selected part in order to show where the next part is going to be. One of these previews is shown as the transparent part with the selection box in the image below.
I disabled the Archivable property of these previews in order to prevent them from saving, but they still persist through a crash in Team Create, so I’m trying to find a way to get rid of them whenever the plugin user leaves.
Possible Team Create Bug?
Unless maybe non-archivable assets persisting through a crash in Team Create is actually a bug that should be reported? They don’t save to the game normally when publishing, which is expected behavior.
Try the Unloading event. If that doesn’t work, you can just mark the temporary parts with a tag and remove all parts with that tag when the plugin loads in, but that’s more of a band-aid than an actual solution.
Already tried that (Unloading), didn’t work. I thought about the band-aid solution that you suggested, and will probably implement it in the meantime, but the biggest issue with that is that other users in your team create session will have to deal with your preview parts until you load back in.
Unless they have the plugin as well, then I can make it cleanup other players parts whenever they leave, but I would prefer some way that doesn’t require everyone in a session to have my plugin installed.