Execute plugin code after user crashes in Team Create

Query

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?

Goal

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.

2 Likes

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.

3 Likes

Totally agree with @posatta, I was literally about to say the same thing.

1 Like

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.

Despite how good that would look for my sales. :wink:

The previews are unnecessarily being parented to the workspace. I’ll just parent them to the camera and then do as you suggested. @posatta

Edit: Non-archivable instances that exist inside the camera seem to work as expected when crashing (i.e they don’t save). Kind of odd that it doesn’t behave this way in the workspace.