# Group vs layer vs container

**URL:** <https://phaser.discourse.group/t/group-vs-layer-vs-container/11036>\
**Category:** Phaser 3\
**Created:** [January 13, 2022, 4:00pm UTC](https://phaser.discourse.group/t/group-vs-layer-vs-container/11036 "2022-01-13T16:00:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmakrzem](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/mmakrzem/32/6112_2.png) [@mmakrzem](https://phaser.discourse.group/u/mmakrzem)\
**Post date:** [January 13, 2022, 4:00pm UTC](https://phaser.discourse.group/t/group-vs-layer-vs-container/11036/1 "2022-01-13T16:00:06Z")

</div>

I just started using Phaser v3 a few days ago.

I have a bunch of graphic and text objects that are spaced out on the screen how I want. I want to move them all together in a circular path.

I thought that if I put them all in the group, I can then use .setX, .setY but that makes the graphic objects move correctly but the text objects snap to where the x,y value is being set on the group.

I then noticed that there is also a layer and a container object.

What is the proper way to “group” things in a scene so that I can get a parent/child relationship and if I adjust the parent, then the parent’s transform control the pose of all the children relative to it.

What are the differences between groups, containers and layers and when I should choose one over the other?

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [January 13, 2022, 4:00pm UTC](https://phaser.discourse.group/t/group-vs-layer-vs-container/11036/2 "2022-01-13T16:00:21Z")

</div>

Container.

---

<div class="post-metadata">

**Author:** ![mmakrzem](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/mmakrzem/32/6112_2.png) [@mmakrzem](https://phaser.discourse.group/u/mmakrzem)\
**Post date:** [January 13, 2022, 4:44pm UTC](https://phaser.discourse.group/t/group-vs-layer-vs-container/11036/3 "2022-01-13T16:44:57Z")

</div>

Could someone explain the differences between groups, containers and layers and when I should choose one over the other?

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [January 13, 2022, 11:02pm UTC](https://phaser.discourse.group/t/group-vs-layer-vs-container/11036/4 "2022-01-13T23:02:29Z")

</div>

A group is just a list, a logical collection. It’s not displayable. Group methods like `setX()` are just shortcuts setting properties of the group members.

A layer is a visual collection, but it doesn’t do any transforms, only alpha and visibility and masking.

A container is a display container that transforms its children.
