I am attaching child object to parent using .attach() method.(Too keep the object’s world transformation)
I want to detach that specific child object from its parent.
What can be the possible solution…?
I am attaching child object to parent using .attach() method.(Too keep the object’s world transformation)
I want to detach that specific child object from its parent.
What can be the possible solution…?
Try this:
const parent = object.parent;
parent.remove( object );
object.matrixWorld.decompose( object.position, object.quaternion, object.scale );
BTW for anyone arriving via search engine like I did, there is now object3d.removeFromParent()
:
https://threejs.org/docs/index.html?q=obje#api/en/core/Object3D.removeFromParent