From 048ca8d78150143f8717e8de407eede555bddf9b Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 21:10:57 +0000 Subject: [PATCH] Changes Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com> --- src/components/three/XRGrabbable.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/three/XRGrabbable.tsx b/src/components/three/XRGrabbable.tsx index d8ac111..6404ef8 100644 --- a/src/components/three/XRGrabbable.tsx +++ b/src/components/three/XRGrabbable.tsx @@ -57,6 +57,17 @@ export function XRGrabbable({ allowScale = false, lockedActive = false, onGrabSt const haloRef = useRef(null); const everGrabbed = useRef(false); + // Reset scale to 1 (position/rotation kept) whenever resetScale() is called. + const scaleResetNonce = useModelStore((s) => s.scaleResetNonce); + useEffect(() => { + const g = groupRef.current; + if (!g) return; + g.scale.set(1, 1, 1); + // Abort any in-progress two-hand scaling so it doesn't snap back. + dual.current = null; + single.current = null; + }, [scaleResetNonce]); + useFrame(() => { const group = groupRef.current; if (!group) return;