PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Remove

The Remove function sets the object’s Instance/Parent to nil, and does the same for all its descendants.

If the object is referenced before being removed it is possible to retrieve the object at a later point.

Returns

Return Type Summary

Code Samples


Instance:Remove

The following code demonstrates how a part can be re-added to the DataModel after being removed:

local part = Instance.new("Part", Workspace)
print(part.Parent)
--> Workspace

part:Remove()
print(part.Parent)
--> nil

part.Parent = Workspace
print(part.Parent)
--> Workspace