PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

Destroying

The Destroying event fires immediately before the Instance or one of its ancestors is destroyed.

The Instance will never be deleted from memory while a connected function is still using it. However, if the function yields at any point, the Instance and its descendants will be parented to nil.


Code Samples


Using the Destroying Event

This sample demonstrates how an Instance being destroyed remains in place until the connected function yields.