애니메이션 테스트

This commit is contained in:
2026-08-26 09:47:39 +09:00
parent 7204afae54
commit 65024110df
3 changed files with 116 additions and 14 deletions

View File

@@ -183,6 +183,13 @@ void Setup(Vrm10Instance vrm)
? Quaternion.Euler(0f, 180f, 0f) // VRM 은 +Z 를 향하므로 돌려세운다
: Quaternion.identity;
// 중요: Vrm10Instance.Runtime 은 지연 생성 프로퍼티다. 여기서 한 번 접근해
// 컨트롤 리그를 미리 만들어 둔다. 컨트롤 리그가 생성될 때 Animator.avatar 가
// 교체되는데, 그 전에 붙은 컴포넌트들은 GetBoneTransform() 으로 실제 메시 본을
// 잡아버린다. 그 본은 매 프레임 ControlRig.Process() 가 덮어쓰므로 우리가
// 가한 회전이 전부 지워진다. 반드시 컴포넌트 부착보다 먼저 접근해야 한다.
_ = vrm.Runtime;
var avatar = currentRoot.AddComponent<VrmAvatar>();
avatar.Bind(vrm);
Current = avatar;