How can I do this?

Hi,
I’m trying to do something like on follow image:
example
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?

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

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

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

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

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.

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
From this source:

2 Likes