# How can I do this?

**URL:** <https://phaser.discourse.group/t/how-can-i-do-this/5994>\
**Category:** Phaser 3\
**Created:** [April 19, 2020, 10:14pm UTC](https://phaser.discourse.group/t/how-can-i-do-this/5994 "2020-04-19T22:14:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpusam](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/cpusam/32/3136_2.png) [@cpusam](https://phaser.discourse.group/u/cpusam)\
**Post date:** [April 19, 2020, 10:14pm UTC](https://phaser.discourse.group/t/how-can-i-do-this/5994/1 "2020-04-19T22:14:53Z")

</div>

Hi,  
I’m trying to do something like on follow image:  
 ![example](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/0/034a186e0f492d0980a4914abee8d919ee134b0d.png)  
I have tried with containers but the collision on the children are deactivated (just keep the overlap).

How should I do to get what I want with the image?

---

<div class="post-metadata">

**Author:** ![ReydVires](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/reydvires/32/939_2.png) [@ReydVires](https://phaser.discourse.group/u/ReydVires)\
**Post date:** [April 19, 2020, 10:21pm UTC](https://phaser.discourse.group/t/how-can-i-do-this/5994/2 "2020-04-19T22:21:38Z")

</div>

Show the current relevant code, It seems you not register the collider yet. I wonder, this must be simple.

---

<div class="post-metadata">

**Author:** ![cpusam](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/cpusam/32/3136_2.png) [@cpusam](https://phaser.discourse.group/u/cpusam)\
**Post date:** [April 19, 2020, 10:38pm UTC](https://phaser.discourse.group/t/how-can-i-do-this/5994/3 "2020-04-19T22:38:25Z")

</div>

I cannot show code, because of contract, but my container I put on extended from phaser sprite.  
So, I make something like:

```javascript
this.physics.add.collider(oneSprite, otherSpriteInsideContainer, callback);

```

do should I put the container in place of otherSpriteInsideContainer? (to have collision, not overlap)

---

<div class="post-metadata">

**Author:** ![cpusam](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/cpusam/32/3136_2.png) [@cpusam](https://phaser.discourse.group/u/cpusam)\
**Post date:** [April 19, 2020, 11:46pm UTC](https://phaser.discourse.group/t/how-can-i-do-this/5994/4 "2020-04-19T23:46:08Z")

</div>

Well, I found that container disable the physics.  
I just need some way to keep the sprite child with collision.  
I will search for a final solution.

---

<div class="post-metadata">

**Author:** ![cpusam](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/cpusam/32/3136_2.png) [@cpusam](https://phaser.discourse.group/u/cpusam)\
**Post date:** [April 19, 2020, 11:51pm UTC](https://phaser.discourse.group/t/how-can-i-do-this/5994/5 "2020-04-19T23:51:58Z")

</div>

Oh sh\*\*, I just found how to enable physics with containers!  
To anyone who has difficult like mine:  
[https://labs.phaser.io/edit.html?src=src\game%20objects\container\arcade%20physics%20body%20test.js](https://labs.phaser.io/edit.html?src=src%5Cgame%20objects%5Ccontainer%5Carcade%20physics%20body%20test.js)  
From this source:

> [@Containers vs groups](https://phaser.discourse.group/t/containers-vs-groups/3371):
>
> Hi guys, I’m new to Phaser. I’m trying to get my head around Containers and Groups. It seems that Containers have been introduced into Phaser 3 and I can’t find any tutorials regarding them. Can you please provide some use cases when I use Containers and when should I use Groups? Thanks.
