Group

Inherits: Node

A Group is a way to organize Systems.

Description

Sometimes it is very useful to put similar Systems together in a Group so that they can be processed or not processed together. This is sometimes more simple than removing a Component from an Entity you want to control processing on.

In other ECS frameworks, this is sometimes refered to as a World.

How It Works

To use it, you simply add a Group node to your Scene, and attach Systems to that Node. The example below shows you how that might look.

_images/groups.png

In the Scene we have two Groups named RotatingGroup and MovingGroup, and each has a System attached to it respectively. When your game now runs, you can choose to update all Systems, or you can control which Systems to process based upon the Group they are in.

Then, when we want to update only one specific Group of Systems we can do this

func _process(delta):
    ECS.update('rotatingsystem')