How to enable gizmo bounding box drag only by left click mouse

I would like to inactivate bounding box dragging when l right click and middle click. Is there any event property in gizmomanager to do that?

Hello @mathus1 , how are you doing?

I’m not sure if I fully understand what you are trying to achieve. You can use GizmoManager.boundingBoxGizmoEnabled to enable and disable drag on bounding box gizmo.

I’ve made a Playground sample where I use PointerDown and Up events to enable and disable the gizmo. Is that what you are trying to do?

Babylon.js Playground (babylonjs.com)

Thank you. That is exactly what I am trying to do. The only problem with the “boundingBoxGizmoEnabled” approach is that when you press the key “q” the bounding box is toggled (I use the same functionality to activate or deactivate it in my app) but when I use pointer up right-click on the object that had been previously inactivated, the bounding box is reactivated which is not desired. Is there some workaround to overcome this problem?

Maybe you can use a flag force the behavior of the “q” key press.

I added a to control the boundingBoxGizmoEnabled depending on “q” been pressed or not.

Babylon.js Playground (babylonjs.com)

1 Like

What a great idea. Thank you for helping me with this issue