remove nodes from a group

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Yamz

How can I remove a node that belongs to a group or all nodes that belong to the group

:bust_in_silhouette: Reply From: jgodfrey

You can remove a node from a group via remove_from_group(groupName) method, as documented here:

You can remove all nodes from a group by iterating over the group and removing each node using the above. So, something like:

for node in get_tree().get_nodes_in_group("rocks"):