Skip to content

Add a way to remove all children from a node quickly #764

Open
godotengine/godot
#94163
@Shadowblitz16

Description

@Shadowblitz16

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 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Ready for Review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions