removing parents... in python?

just confused as how to do this, I thought that maybe

object.setParent("")

would work, but it didn’t. Anyone know the command for this?

removeParent()

1 Like

Are you trying to remove the parent or put one on? An empty string wont work.
Here is what it says in the documentation. Try putting in all three arguments.

setParent(parent, compound, ghost)

Sets this object’s parent. Control the shape status with the optional compound and ghost parameters: compound=1: the object shape should be added to the parent compound shape (default) compound=0: the object should keep its individual shape. In that case you can control if it should be ghost or not: ghost=1 if the object should be made ghost while parented (default) ghost=0 if the object should be solid while parented Note: if the object type is sensor, it stays ghost regardless of ghost parameter

Parameters:
parent (KX_GameObject) - new parent object.
compound (int) - whether the shape should be added to the parent compound shape
ghost (int) - whether the object should be ghost while parented


Also: To remove parent use object.removeParent()

yeah, I just figured out the removeParent() thanks!