Collision with object children?

I have group enemies and overlap collision logic. So when player overlap/touch enemy it trigger player explosion which is correct but can’t trigger collision with enemy children.
It’s just ignored by player. For example I’m adding long sprite as child to this enemy and I would like to die when touch it as well…
I have tried anything without luck.

I’m not sure what would be the best solution, but I will give it a shot.
The children should also be arcade physics type so they will have a collision shape. Then you could create a group (ex: at the scene level) and add the children in that group. You should be able to handle the overlap collision from there.

Show your code?

If I add children to other group it will be removed as child isn’t it?

BTW not sure why but I think as child it’s work now. Dunno why it wasn’t at first place.
Need to test it more and will let U know when got some issues.

I’m working on Project X game on official Team 17 license. Demo is available on Steam

Hi, glad to hear that the issue has been resolved. Adding the chlldren to a group should not remove the children from their parent, at least I don’t think so. The group would serve as a pile only, a kind of pointer to the children objects.

Just checked - adding enemies.children to other group remove it as children.
*example - enemy fire added to bullets group removed is as children

Ok there is specific way how to make it works!
If we have group ‘enemies’.

Steps when it doesn’t work:

  1. create enemy ship var enemy = enemies.create(…)
  2. create other sprite var sprite= game.create.sprite(…)
  3. add sprite as child: enemy.addChild(sprite)

In this case child won’t interact as enemies group. No collisions.

Steps to make it works:

  1. create enemy ship var enemy = enemies.create(…)
  2. create other sprite var sprite= enemies.create(…)
  3. add sprite as child: enemy.addChild(sprite)

In this case will work because we add sprite as enemies before assigned as child.