PcoWSkbVqDnWTu_dm2ix
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.