diff --git a/packages/r3f/src/extension/components/ProxyManager.tsx b/packages/r3f/src/extension/components/ProxyManager.tsx index 11b3c74..ffc239c 100644 --- a/packages/r3f/src/extension/components/ProxyManager.tsx +++ b/packages/r3f/src/extension/components/ProxyManager.tsx @@ -201,25 +201,31 @@ const ProxyManager: VFC = ({orbitControlsRef}) => { const sheetObject = editableProxyOfSelected.editable.sheetObject const obj = editableProxyOfSelected.object + // interestingly, for some reason, only updating a transform when it actually changes breaks it scrub.current.capture(({set}) => { - set(sheetObject.props, { - ...sheetObject.value, - position: { + if (transformControlsMode === 'translate') { + set(sheetObject.props.position, { + ...sheetObject.value.position, x: obj.position.x, y: obj.position.y, z: obj.position.z, - }, - rotation: { + }) + } + if (transformControlsMode === 'rotate') { + set(sheetObject.props.rotation, { + ...sheetObject.value.rotation, x: obj.rotation.x, y: obj.rotation.y, z: obj.rotation.z, - }, - scale: { + }) + } + if (transformControlsMode === 'scale') { + set(sheetObject.props.scale, { x: obj.scale.x, y: obj.scale.y, z: obj.scale.z, - }, - }) + }) + } }) }} onDraggingChange={(event) => {