# Gizmo Double Pointer Trigger problem

**URL:** <https://forum.babylonjs.com/t/gizmo-double-pointer-trigger-problem/4202>\
**Category:** Questions\
**Created:** [June 30, 2019, 10:06am UTC](https://forum.babylonjs.com/t/gizmo-double-pointer-trigger-problem/4202 "2019-06-30T10:06:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jacob/32/342_2.png) [@Jacob](https://forum.babylonjs.com/u/Jacob)\
**Post date:** [June 30, 2019, 10:06am UTC](https://forum.babylonjs.com/t/gizmo-double-pointer-trigger-problem/4202/1 "2019-06-30T10:06:30Z")

</div>

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](https://www.babylonjs-playground.com/#3B6ZW1#8)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [July 1, 2019, 4:48pm UTC](https://forum.babylonjs.com/t/gizmo-double-pointer-trigger-problem/4202/2 "2019-07-01T16:48:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [July 1, 2019, 10:18pm UTC](https://forum.babylonjs.com/t/gizmo-double-pointer-trigger-problem/4202/4 "2019-07-01T22:18:27Z")

</div>

Pinging @trevordev

---

<div class="post-metadata">

**Author:** ![trevordev](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/trevordev/32/16_2.png) [@trevordev](https://forum.babylonjs.com/u/trevordev)\
**Post date:** [July 1, 2019, 11:38pm UTC](https://forum.babylonjs.com/t/gizmo-double-pointer-trigger-problem/4202/5 "2019-07-01T23:38:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jacob](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jacob/32/342_2.png) [@Jacob](https://forum.babylonjs.com/u/Jacob)\
**Post date:** [July 4, 2019, 10:47am UTC](https://forum.babylonjs.com/t/gizmo-double-pointer-trigger-problem/4202/6 "2019-07-04T10:47:23Z")

</div>

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

Appreciate your help and pls confirm whether this is a bug

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [July 4, 2019, 11:13am UTC](https://forum.babylonjs.com/t/gizmo-double-pointer-trigger-problem/4202/7 "2019-07-04T11:13:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jacob](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jacob/32/342_2.png) [@Jacob](https://forum.babylonjs.com/u/Jacob)\
**Post date:** [July 4, 2019, 2:03pm UTC](https://forum.babylonjs.com/t/gizmo-double-pointer-trigger-problem/4202/8 "2019-07-04T14:03:31Z")

</div>

for a good BBQ they should come here to Cyprus 😉

---

<div class="post-metadata">

**Author:** ![trevordev](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/trevordev/32/16_2.png) [@trevordev](https://forum.babylonjs.com/u/trevordev)\
**Post date:** [July 8, 2019, 5:09pm UTC](https://forum.babylonjs.com/t/gizmo-double-pointer-trigger-problem/4202/9 "2019-07-08T17:09:48Z")

</div>

See [https://playground.babylonjs.com/#RRYPSU#2](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.
