There are similarities but also some important differences between the grouping and attaching feature in CoSpaces. So how to know what to choose? But before I’ll explain, here again how to do it in the first place.

To create a group select the objects and click the group option or press the g key.

When grouping two objects, an enclosing group object will be created. All objects are child elements of this object.

Now imagine that we want to move this group forward using Blockly. But what is forward if, for example, we set the man to look in one direction and the dog looks in the other direction? We don’t really know until we try it out, and sometimes the group’s “forward” doesn’t make much sense.

On the other hand, when we attach one object to another we are going to create a parent-child relationship between them.

The dog is now a child element of the man and when the man is moving forward the dog will follow along, no matter what direction the dog is looking at.

The interactivity issue is that I need to turn a set of 9 blocks together when one is clicked. I tried using the block with the origin but it doesn’t seem to spin around the center block.
I am not sure how to create this in JavaScript, I have only really used it for basic commands.

the example below shows how you can use attaching to implement Rubic’s Cube. The idea is to keep relations between outline blocks and center block only during rotation. Outline blocks become children of center block by invoking method parentcube.add(childcube). After rotation is finished they are removed from their parent by inkoving method removeFromParent().

All cubes which changed their places by rotation are swapped with cubes on their original positions to get a right place in three-dimensional source array.