Material Box

Material Box

WEB Design & Material Images

Godot - Remove from group

Godot

This is how to remove a node from a group using GDScript in Godot 4.


You can remove a node from a group using remove_from_group().

remove_from_group() has the following characteristics:
- Specify any group name as an argument
- If the node does not exist in the group, the process is ignored

remove_from_group("group_name")

To remove all nodes or individually checked nodes, iterate through the groups.

var group = get_tree().get_nodes_in_group("group_name")

for node in group:
	node.remove_from_group("group_name")

Godot

TitleGodot - Remove from group

CategoryGodot

Created

Update

AuthorYousuke.U