Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Yamz |
How can I remove a node that belongs to a group or all nodes that belong to the group
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Yamz |
How can I remove a node that belongs to a group or all nodes that belong to the group
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"):
node.remove_from_group("rocks")