Problem with scaling model using MultiPointerScaleBehavior

Hi, I’m trying to implement scaling and rotation of a model in immersive mode.
I’ve implemented hand tracking and enabled scaling and rotation using MultiPointerScaleBehavior. The problem is, it works well in playground, but when I implement the same in the application I’m working on, it’s not working like the playground. I can able to rotate the model perfectly using pointers, but when I try to scale the model by selecting it using two pointers, the model just slips away and scales itself abnormally. I couldn’t control the scaling process. What is my problem here, and how can I fix it?

Following is the code I used.
const boundingBox = BoundingBoxGizmo.MakeNotPickableAndWrapInBoundingBox(mesh)
const sixDofDragBehavior = new SixDofDragBehavior()
sixDofDragBehavior.allowMultiPointer = true;
const multiPointerScaleBehavior = new BABYLON.MultiPointerScaleBehavior()

Hello and welcome to the Babylon community!
Have you seen this topic? MultiPointerScaleBehavior not multi-point? - Questions - Babylon.js (

Yes, I checked this link already. I even took the
"enablePointerSelectionOnAllControllers: true " implementation from it, it worked fine in my code. The problem is when I try to pick two points to scale the model, it just slips away from the current position and appears 4-5 times larger than the original size. This happens exactly when I use the second pointer to select the model.
Kindly excuse my English.

@RaananW any idea of what could be going on?

can you share a playground so I can understand fully what the issue is?

@RaananW I just implemented something similar to the code from the topic @carolhmj has mentioned. The only thing I added to the code in the playground is Hand tracking. It works fine in the playground.

This is the modified version of the original code mentioned by carolhmj