Godot 4.3
I’m not sure the difference between these two and when to use one over the other. I have been putting everything into Global Groups, but maybe that’s not correct.
Godot 4.3
I’m not sure the difference between these two and when to use one over the other. I have been putting everything into Global Groups, but maybe that’s not correct.
Nothing really wrong with it per se. If you’ve been putting everything in Global Groups, that’s fine for functionality, but you might be “polluting” your global namespace with groups that could be scene-local. It’s a bit like using global variables when local ones would suffice. There are minimal performance issues, But you might have some issues with the fragility of your code. For instance Global Groups are automatically freed when the scene is freed. You have to explicitly free them in your code. You also make It harder to debug issues when many systems interact through global groups rather than more explicit connections. Another consideration Using Global Groups extensively can break proper encapsulation, making your game architecture more fragile.
I use Scene Groups when I know no other scene will use the group, global groups allows for a nice check mark to tick instead of writing the same group name exactly the same. There is no functional difference between Scene Groups and Global Groups, a group set to global is easier to assign.
The same underlying logic is used for both Global and Scene groups. Groups with the same name are considered one and the same. This feature is purely organizational.