Hello, I would like to temporary disable BABYLON.AxisDragGizmo. I can do by using enable property, but doing this I remove the arrows allowing to move the mesh. What I am trying to accomplish is to check in the dragBehavior.onDragObservable event if the mesh is intersecting another mesh, and I would like to stop the movement of the current mesh. I can understand when a mesh intersects another, but I cannot “cancel” the onDragObservable movement, and as I mentioned disabling the AxisDragGizmo has that side effect.
first clear drag observable, so only yours is taken into account. Then, check if mesh intersects. If not, then apply movement delta,. Check again if intersect and if it does with applied delta, then cancel movement.
Also, note world matrix is updated as it’s been used for mesh intersection.
Perfect, thank you very much. I played a lot with movement and collision for far, and I have found validateDrag function on PointerDragBehavior, where I can decide if the drag should be confirmed or not. Do you think it could be a possible alternate solution to avoiding collision between meshes or is it better with your solution?
Yes, but I cannot find it for Gizmo, is that correct? Should I use PointerDragBehavior intead of Gizmo? Do you have any sample using validateDrag in this way, because I’m having some difficulty in understanding the right way to use it…