diff --git a/Assets/UniGLTF/Runtime/MeshUtility/MeshAttachInfo.cs b/Assets/UniGLTF/Runtime/MeshUtility/MeshAttachInfo.cs index 54f36ee4f..b0020bbd8 100644 --- a/Assets/UniGLTF/Runtime/MeshUtility/MeshAttachInfo.cs +++ b/Assets/UniGLTF/Runtime/MeshUtility/MeshAttachInfo.cs @@ -20,7 +20,19 @@ namespace UniGLTF.MeshUtility if (Bones != null) { // recalc bindposes - Mesh.bindposes = Bones.Select(x => x.worldToLocalMatrix * dst.transform.localToWorldMatrix).ToArray(); + Mesh.bindposes = Bones.Select(x => + { + if (x != null) + { + return x.worldToLocalMatrix * dst.transform.localToWorldMatrix; + } + else + { + // ボーンが削除された + return dst.transform.localToWorldMatrix; + } + } + ).ToArray(); if (dst.GetComponent() is SkinnedMeshRenderer dstRenderer) {