[Resolved] multiple "bodyparts" each with their own touch event question

Hey guys,

I am trying to get this working, I want to have an object that is broken up into 2 parts the head and the body…each with their own touch events… Sounds simple and I have it working somewhat simply by adding event listeners to each part of the body(they are seperate images) however I need to be able to group those images together so they move together when the object moves…simple enough I put them in a group…now I also need to put the group(containing the head and body) into another group for the level specific stuff…this is where the problem arises as you cant(that im aware) but a group into another group…

Now a few questions

Is there any way you can have one touch event for the whole object(body and head) and somehow get the actual touch point and call different functions according to where they player touched?

Is there any way to easily “attach” 2 objects together without grouping them so that i can manipulate their coordinates while still having them in the large level group(containing multiple head and bodies)?
If this is confusing or more info is needed please let me kno and thanks in advanced! [import]uid: 141138 topic_id: 25850 reply_id: 325850[/import]

You can insert a group into another group :slight_smile: [import]uid: 52491 topic_id: 25850 reply_id: 104614[/import]

Thanks Peach,

I was unsure if this would work or not as i remember reading in documentation that an object can only belong to one group at a time… I guess i misunderstood what it meant ><

Thanks for your time! [import]uid: 141138 topic_id: 25850 reply_id: 104661[/import]

Double post removed as requested and marking as resolved now.

As I said I believe a group within a group should be just fine, I’ve done it before though in very simple situations - so if you encounter issues just bump and I’ll try to help you tackle it a different way.

The main time groups get behave weird is when physics/collision detection comes into play but even then it depends on the situation.

Peach :slight_smile: [import]uid: 52491 topic_id: 25850 reply_id: 104820[/import]