Gizmo Double Pointer Trigger problem


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:

Hum I did not check a lot but I saw there were errors on the console

Pinging @trevordev

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.

Here is the PG

Appreciate your help and pls confirm whether this is a bug

@trevordev will have a look on Monday, most of the US team is off till then with the 4th of July enjoying amazing BBQ :slight_smile:

for a good BBQ they should come here to Cyprus :wink:



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.