Problem with creating sensor child to compound parent

I’m having a problem with sensor objects. I have a compound parent and I need to create sensor objects in-game.
I have this python script I use:

added_object = own.scene.addObject('GROUP-SENSOR', own, 0)
    added_object.groupMembers["pal_SENSOR"].setParent(own)

The problem with this is that the created sensor has the same rigid body physics as the compound parent object. The sensor should be able to go through objects and not have the same collision as the parent.
Do I have to specify something in the script for the created object to be not compounded?

As I demonstrated in your other thread, setParent can take up to 3 arguments. By just using the first argument, the default I believe is for compound = True and ghost = False. So,

object.setParent(newObject, False, False)

sets the object’s parent to ‘newObject’ with compound as False and ghost as False

or in your code:

added_object.groupMembers["pal_SENSOR"].setParent(own, False, False)

1 Like

Thank you, I get it now. I didn’t know exactly how the compound works.

1 Like