I have the following scenario:
I add a BABYLON.ActionManager.OnDoublePickTrigger on a mesh so that when I double click a BoundingBox gizmo is added on the mesh. Now when I single click on any other mesh, I disable the gizmo using
gizmo.attachedMesh = null;
Now, when I try to double click the previous mesh on which I had added the trigger, nothing happens. Is this a bug?
Here is the playground: https://www.babylonjs-playground.com/#3B6ZW1#8
Hey @Jacob I think the issue may be that it looks like you are creating the double click event multiple times. I tried creating a smaller repro and it seemed to work. Does this playground work for you? Babylon.js Playground
So here is the problem @trevordev
Based on your scene I created 2 spheres but I am using boundinbox to attach to the mesh(BABYLON.BoundingBoxGizmo.MakeNotPickableAndWrapInBoundingBox(mesh)) because in my project I have complex (non-standard BABYLON) meshes, which when clicked if
MakeNotPickableAndWrapInBoundingBox is NOT set the rotationSpheres don’t behave as expected
Now the error scenario is as following:
if I doublick the mesh, everything works fine, but I return to the SAME mesh and doubleclick the BouningBox does not appear.
What’s happening is that the “gizmo.attachedMesh = null” somehow is also REMOVING the doubleclick trigger.
MakeNotPickableAndWrapInBoundingBox makes the mesh (the one with the double click trigger) not pickable so it can not be picked. If instead you wrap all your object in a bounding box and then attach the double click action to the bounding boxes instead it should work.