#Question about node groups

1 messages · Page 1 of 1 (latest)

empty jolt
#

I am very new to godot, and am working on my second game of the 20 game development challenge. I am trying to understand the way my node groups are behaving.

I am using is_in_group() to check if the object colliding belongs to a specific group so I can handle different types of collisions broadly.

In my main scene, when I instantiate a child scene and add it to the desired group, my conditional check to see if the collider is in the "enemy" group does not run. (as if it was not added to the group).

If go into the child scene before adding it to the main scene, and add the specific node to the group there, and then instantiate it in my main scene, it works.

Hopefully someone knows the reason for this. I am thinking it has something to do with adding the entire scene node into a group vs going into the scene and adding a specific child node to the group.

Hopefully this makes since.

cold pond
#

Did you try adding the node to the group using the inspector? then when you instantiate it, it should always be in the group.

balmy remnant
#

Case sensitivity maybe, or some other typo in group name?