Hi all (@trevordev)
I have my meshes wrapped with a boundingbox using the MakeNotPickableAndWrapInBoundingBox command. At some stage using a JS function I need to clone the wrapped mesh.Therefore I need to remove the boundingbox. How do I do that ?
I have created a PG scenario, where if I click anywhere outside the boundingbox mesh, the boundingbox with it’s gizmo should be removed. What is the command if any exists? https://playground.babylonjs.com/#TMBNGD#4
As you can see from the PG sample, that setParent(null) does NOT do the job. On the screen it’s still the bounding box and not the wrapped mesh… https://playground.babylonjs.com/#T9FAAW#1
setParent will unparent the sphere and the bounding box but the bounding box is still in the scene and clickable. so if you click on the sphere, the raycast will pick the bounding box.
I didn’t manage to filter the raycast to not pick the bounding box. Doing that:
sphere.setParent(null);
boundingBox.dispose();
I get the sphere picked. But You have to recreate the bounding box after.