diff --git a/packages/frontend/src/world/room/engine.ts b/packages/frontend/src/world/room/engine.ts index affd9a46f6..1fffd30577 100644 --- a/packages/frontend/src/world/room/engine.ts +++ b/packages/frontend/src/world/room/engine.ts @@ -1241,6 +1241,9 @@ export class RoomEngine extends EventEmitter { const selectedObject = this.selected.objectEntity.rootMesh; this.clearHighlight(); + const initialPosition = selectedObject.position.clone(); + const initialRotation = selectedObject.rotation.clone(); + // 子から先に適用していく const setStickyParentRecursively = (mesh: BABYLON.AbstractMesh) => { const stickyObjectIds = Array.from(this.roomState.installedObjects.filter(o => o.sticky === mesh.metadata.objectId)).map(o => o.id); @@ -1278,9 +1281,6 @@ export class RoomEngine extends EventEmitter { const dir = this.camera.getDirection(BABYLON.Axis.Z).scale(this.scene.useRightHandedSystem ? -1 : 1); - const initialPosition = selectedObject.position.clone(); - const initialRotation = selectedObject.rotation.clone(); - let sticky: string | null; this.grabbingCtx = {