Positioning issues with gizmos attached to bones

I am creating a feature that allows you to attach a gizmo to a bone and rotate it.
The implementation is to attach a mesh to the bone, click on the attached mesh and the rotation gizmo will attach the bone with the attached mesh to the RotationGizmo.

I load the initial model and it works as I thought it would, but when I attach a position gizmo to the character mesh to move it around and then try to use the Rotationgizmo on the bone, the PositionGizmo is created at the position where the character was at the beginning.
Here is the related PG.

It will be generated as shown in the below capture.

There are two meshes in the model, but to move them together, I created a TranfromNode as the parent and registered the meshes as children.
Is this a problem?

The red spheres on the bones are all moving and the position of the bones are also changing according to PositionGizmo, but what could be the problem?

Please help.

cc @Cedric

There is an additionalTransformNode that can help for that task

https://doc.babylonjs.com/typedoc/classes/BABYLON.PositionGizmo#additionalTransformNode

and fixed in the PG:

2 Likes