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

AncestryChanged

Fires when the Instance/Parent property of the object or one of its ancestors is changed.

This event includes two parameters, child and parent. Child refers to the Instance whose Instance/Parent was actually changed. Parent refers to this Instance’s new Instance/Parent.

If you need to detect when an instance is destroyed via Instance/Destroy, consider the Instance/Destroying event instead.



                        

Parameters

Name Type Default Description

The Instance whose Instance/Parent has been changed.

The new Instance/Parent of the Instance whose Instance/Parent was changed.


Code Samples


Instance.AncestryChanged

The below example would print “Part is now a child of Model”.