Python : unparent object?

Hi,

Is that possible to unparent an object in realtime?
like

camera.setParent(None)

Note : I want my objects to be parented when I edit my .blend, but I’d like to unwrite parent-children relations when I start the game.
It seems that settings done in the edit panel can’t be overwritten with Python.

http://www.blender.org/documentation/249PythonDoc/GE/GameTypes.KX_ParentActuator-class.html#object

You could use the parent actuator and set the parent object to none.

parent_actuator.object = None

Didn’t really try it myself, but according to the docs, it should work. I thought obj.setParent(None) would work as well, but I assume you already tried it and it doesn’t?

guys, get used to using the docs, (search for parent)
http://www.blender.org/documentation/249PythonDoc/GE/GameTypes.KX_GameObject-class.html

Sorry ideasman42, I was stuck on the setParent method (here, didn’t check the listing at top page, and thought removeParent would be right under the setParent method if it exists).
Thanks for the docs and the time you spent on it.

  • I want to hide myself *