How I can create a group in code

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

I have some items that i dropped into the scene, how i can create a custom group in code so i can add the nodes that entered the item area?

:bust_in_silhouette: Reply From: Calinou

There is no central place where you need to register groups. If you call add_to_group("group_name") on a Node, the group is automatically created and can be reused anywhere else.