Adding my child error

I wanted for the object I call to act as my child. I use the Edit Object to call my child from an invisible layer and blender crashes. Testing adding the same object except removing the parent child relationship works fine however. Is there some reason why this wouldn’t work? Are there any alternative solutions for this problem?

It sounds like you are trying to call an object which is already the child of an off-layer object, without calling its parent. This is not going to give good results.
The object you want to have as a child should not have a parent until you tell it to have one.
Try placing, on the child object, an always sensor set to Tap connected to a Parent actuator which sets this object’s parent to whatever object you’re going for.
This will set the object’s parent as soon as it’s added into the visible layer.

For the reason why it wouldn’t work: I’m not sure, but it doesn’t surprise me that trying to add a child from an invisible layer would crash Blender. It just seems natural to parent it afterward, or spawn the child in with the parent at the same time.

For an alternative, add the child via Python and then parent it to whatever object (the calling object).

are you using any constraints?

I am not using any additional constraints, but I will definitely try the option of parenting via python if that is an option. Thanks.




import bge

cont = bge.logic.getCurrentContoller()

own = cont.owner

if 'MyChild' not in own:
    own['MyChild']= bge.logic.getCurrentScene().addObject('MyChildOnAHiddenLayer,own,0)
    own['MyChild'].setParent(own,0,1)


How would I check whether myChild is in own or not?

if ‘MyChild’ in own:

A crash is always worth a bug report.