Instance:ParentAllChildren(parent)

If we already had Instance:ClearAllChildren(), it would be logical to have Instance:ParentAllChildren(parent)

Acts just like

for k,v in pairs(object:GetChildren()) do -- object is the instance :ParentAllChildren is called upon
v.Parent = object2
end

We are are lazy people. It would be nice if Instance:ParentAllChildren() was a thing.

3 Likes

Why would you ever be doing this? Do you have a use case?

3 Likes

Well, Iā€™m trying to script a live switch between two types of characters, human and monster. Humans and monsters have different rigs, and I have to constantly use for k,v in pairs() do to move parts together to switch between the two in the same Character model.

(Tbh, I really donā€™t know how to do the switching :frowning:)

Yet we write games existing out of 50000+ lines of code.

To be honest though, I definitely do not think we need this. You can already achieve this with 3 simple lines of code that do not require any thorough programming knowledge. The fact that ClearAllChildren() exists shouldnā€™t be used as an argument to request the opposite. As far as I know ClearAllChildren() has been around since before Roblox moved from being a game to a game platform. As a result a lot of legacy features like ClearAllChildren() are still around which wouldnā€™t be added now if they were to not exist.

1 Like

ClearAllChildren is newer than Destroy and locks the parents of the children like Destroy does.

1 Like

ClearAllChildren is kind of an awkward method. One of the only times Iā€™ve tried using it is to clear the workspace, which you canā€™t do because it errors on Terrain.

No, I donā€™t think ParentAllChildren is a good idea. Just write a function for it and put it in a utility modulescript.

1 Like

Hm, based on all of your thoughts on this, I believe now that this will never be added. Should this thread be closed?

ClearAllChildren() is extremely useful (to me anyways). I find myself constantly using it to clear run-time ā€˜tempā€™ folders (For example, the ā€œMapā€ folder in my game) without much of a hassle.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.