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() {