# Mesh.addChild() with negative scaling transforms child rotation incorrectly

**URL:** <https://forum.babylonjs.com/t/mesh-addchild-with-negative-scaling-transforms-child-rotation-incorrectly/25052>\
**Category:** Bugs\
**Created:** [November 6, 2021, 11:37pm UTC](https://forum.babylonjs.com/t/mesh-addchild-with-negative-scaling-transforms-child-rotation-incorrectly/25052 "2021-11-06T23:37:00Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![ecoin](https://avatars.discourse-cdn.com/v4/letter/e/8e7dd6/32.png) [@ecoin](https://forum.babylonjs.com/u/ecoin)\
**Post date:** [November 8, 2021, 11:06pm UTC](https://forum.babylonjs.com/t/mesh-addchild-with-negative-scaling-transforms-child-rotation-incorrectly/25052/22 "2021-11-08T23:06:59Z")

</div>

Thank you @Cedric , confirming the PR works.

For others who might be reading this, negative scaling does work with Gizmo. Here is a working solution:

1. Copy transform of childMesh to gizmoMesh
2. Sanitize gizmoMesh.scaling to only have positive values
3. Store scaling state of the childMesh before attaching to gizmoMesh with `gizmoMesh.addChild(childMesh, true)`
4. Attach gizmoMesh to GizmoManager `GizmoManager.attachToMesh(gizmoMesh)`
5. Let gizmo do any transform as usual, except negative scaling (need to detach GizmoManager from gizmoMesh first, then apply negative scaling to the gizmoMesh directly)
6. Release the childMesh with `gizmoMesh.removeChild(childMesh, true)`
7. Apply back stored scaling state of childMesh, along with gizmoMesh.scaling to get the final scaling state of the childMesh.

[Previous page](https://forum.babylonjs.com/t/mesh-addchild-with-negative-scaling-transforms-child-rotation-incorrectly/25052.md?page=1)
