Topic was automatically imported from the old Question2Answer platform.
Asked By
gieyan
I am working on a node in my scene tree and i will like to add other nodes in same scene as a member to a group created by the node i am currently working on. My question is can a node be in a Group without being a child to the node creating the group?
Yes. Groups are tagged at the SceneTree level, not the node level.
That’s why you use get_tree().get_nodes_in_group("some_group") not get_node("some_random_node").get_nodes_in_group("some_group"). You can either use add_to_group("some_group") from inside the node’s script or tag it in the editor: