From 4f2ee68cb11b8c90af372337a87e1631e2cec6aa Mon Sep 17 00:00:00 2001 From: user Date: Mon, 4 May 2026 00:16:08 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20:=20=EC=BA=90=EB=A6=AD=ED=84=B0=20root=20?= =?UTF-8?q?localScale=20=EC=9E=90=EB=8F=99=20=EC=A0=95=EA=B7=9C=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Initialize 시 transform.localScale을 Vector3.one으로 강제 - 비-1 scale prefab의 경우 LogWarning 출력 - avatarScale=1이 모든 캐릭터에서 일관되게 시각적 1배를 의미 Co-Authored-By: Claude Opus 4.7 (1M context) --- .../CustomRetargetingScript.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Assets/Scripts/KindRetargeting/CustomRetargetingScript.cs b/Assets/Scripts/KindRetargeting/CustomRetargetingScript.cs index 03cf7b812..89fb1ed48 100644 --- a/Assets/Scripts/KindRetargeting/CustomRetargetingScript.cs +++ b/Assets/Scripts/KindRetargeting/CustomRetargetingScript.cs @@ -210,6 +210,9 @@ namespace KindRetargeting InitializeIKJoints(); + // root localScale을 1로 정규화 (avatarScale=1이 시각적으로 1배가 되도록) + NormalizeRootScale(); + // 크기 조정 대상 오브젝트 캐싱 CacheScalableObjects(); @@ -1429,6 +1432,24 @@ namespace KindRetargeting Debug.Log("포즈와 회전 오프셋이 재설정되었습니다."); } + /// + /// 캐릭터 root의 localScale을 Vector3.one으로 정규화합니다. + /// 이를 통해 avatarScale=1.0이 시각적으로 정확히 1배가 되도록 보장합니다. + /// 비-1 localScale의 캐릭터 크기 의도는 avatarScale 자체로 표현해야 합니다. + /// + private void NormalizeRootScale() + { + Vector3 currentScale = transform.localScale; + if (currentScale == Vector3.one) return; + + Debug.LogWarning( + $"[CustomRetargetingScript] '{gameObject.name}'의 root localScale이 {currentScale}입니다. " + + "avatarScale=1이 시각적으로 1배가 되도록 자동으로 (1,1,1)로 정규화합니다. " + + "원래 크기 의도가 있다면 prefab 자식 메시에 적용하거나 avatarScale 슬라이더로 조정하세요."); + + transform.localScale = Vector3.one; + } + // 크기 조정 대상 오브젝트 캐싱 메서드 private void CacheScalableObjects() {