How could I keep the object' status(scale,rotation) when i attach to a group with rotation and then attach to scene

I have a group with rotation.setY(-Math.PI/2), and then attach a mech to translation, when i attach to scene, I see both the mesh.position.x and mesh.position.z change to 10, How could i only make the mesh.position.x = 10 only?
const group = new Group();
group.rotation.setY(-Math.PI/2);
group.attach(mesh);
group.position.setX(10);
scene.attach(mesh);
// mesh.position (10,0,10), i want mesh.position (10,0,0) after scene.attach(mesh)

Object3D.attach will modify the childs local position and rotation values such that it stays in the same position in world space. If you don’t want the local transform to be modified use Object3D.add.

2 Likes