Remove (Method): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Camoy No edit summary |
m Text replacement - "</SyntaxHighlight>" to "</syntaxhighlight>" Tags: mobile web edit mobile edit |
||
(20 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
{{deprecated|Use [[ClearAllChildren (Method)|ClearAllChildren]] to get rid of all child objects, or [[Destroy (Method)|Destroy]] to completely destroy this object and its descendants. If you have to remove an object from the game, '''''and you must return it again later''''', set its [[Parent (Property)|Parent property]] to nil.}} | |||
<onlyinclude>{{Method | <onlyinclude>{{Method | ||
|name = Remove | |name = Remove | ||
|description = Sets the Parent property to | |description = Sets the Parent property to {{nil}} and calls Remove() on all children. | ||
|object = Instance | |object = Instance | ||
}}</onlyinclude> | }}</onlyinclude> | ||
Line 7: | Line 9: | ||
{{clear floats}} | {{clear floats}} | ||
{{Example|This is an example of removing a part in the Workspace. Make sure there is one there before trying this. | {{Example|This is an example of removing a part in the [[RBX.lua.Workspace (Object)|Workspace]]. Make sure there is one there before trying this. | ||
< | <syntaxhighlight lang="lua"> | ||
Workspace.Part:Remove() | |||
</ | </syntaxhighlight> | ||
}} | }} | ||
[[Category:Methods]] | [[Category:Methods]] |
Latest revision as of 06:14, 27 April 2023
Deprecated:This item is deprecated. Do not use it for new work. Use ClearAllChildren to get rid of all child objects, or Destroy to completely destroy this object and its descendants. If you have to remove an object from the game, and you must return it again later, set its Parent property to nil.
Remove( ) | |
Returns | nil |
Description: | Sets the Parent property to nil and calls Remove() on all children. |
Member of: | Instance |
Example
This is an example of removing a part in the Workspace. Make sure there is one there before trying this.
Workspace.Part:Remove()