IssueRaiser

Add a way to remove all children from a node quickly

**Describe the project you are working on:** a game in which I am generating a ton of nodes **Describe the problem or limitation you are having in your project:** I am trying to generate a 16x16 plane of objects however everytime I edit the width and height of the grid it needs to be cleared and updated doing so by looping through all nodes is too slow in gdscript and there needs to be a way to clear a branch all at once. possibly through pointers **Describe the feature / enhancement and how it helps to overcome the problem or limitation:** I suggest remove_children() be added as a work around. this would be a fast way of clearing all the children of a node **Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:** `node.remove_children()` **If this enhancement will not be used often, can it be worked around with a few lines of script?:** idk if it would be used often but we already had a merge request [here](https://github.com/godotengine/godot/pull/8337) but was shut down **Is there a reason why this should be core and not an add-on in the asset library?:** because its a simple way to manage nodes without slowing down godot

Posted by Shadowblitz16 on Apr 29, 2020, 12:26 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments

reliability (Software)

Add a way to remove all children from a node quickly

Shadowblitz16Apr 29, 2020, 12:26 AM

**Describe the project you are working on:** a game in which I am generating a ton of nodes **Describe the problem or limitation you are having in your project:** I am trying to generate a 16x16 plane of objects however everytime I edit the width and height of the grid it needs to be cleared and updated doing so by looping through all nodes is too slow in gdscript and there needs to be a way to clear a branch all at once. possibly through pointers **Describe the feature / enhancement and how it helps to overcome the problem or limitation:** I suggest remove_children() be added as a work around. this would be a fast way of clearing all the children of a node **Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:** `node.remove_children()` **If this enhancement will not be used often, can it be worked around with a few lines of script?:** idk if it would be used often but we already had a merge request [here](https://github.com/godotengine/godot/pull/8337) but was shut down **Is there a reason why this should be core and not an add-on in the asset library?:** because its a simple way to manage nodes without slowing down godot

Comments (0)

No comments yet. Start the discussion.

Comment on this issue