Gizmo Double Pointer Trigger problem

Hi

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

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
https://playground.babylonjs.com/#RRYPSU#1

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:

2 Likes

See https://playground.babylonjs.com/#RRYPSU#2

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.