Jump to content

Groups and children of groups?


cbaizen
 Share

Recommended Posts

Let's say I have a group torsos, and each torsos.children has a corresponding heads.children and legs.children.  This means I have group heads and group legs.  If so, can I do torsos.children.addChild(heads.children) ?  I would like each i indexed element of torsos, heads, and legs to move together.  Does it make sense to do this?

 

I also need to be able to determine overlaps between group bullets and each group of body parts.

 

The way I have it now, only group torsos seem to trigger overlap and my children heads and legs do not (bullets pass right through them).

 

Can someone recommend a way to organize the data and be able to determine bullet overlaps to each piece of the body?

 

I got it to work by not using addChilds and just make sure that each i indexed element has the same velocity.  Kind of messy?

Link to comment
Share on other sites

From the overlap method docs:

 

 

 

This function is not recursive, and will not test against children of objects passed (i.e. Groups within Groups).

 

You can put objects inside an array and test that array against the bullets.

Link to comment
Share on other sites

  • 1 year later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...