I’m developing an avatar customization system. There is one base gameObject with and armature and different meshes for each body part. The script replaces the gameObjects body parts. Now, the problem is that when I try to assign the bones to the new mesh (that is already rigged), it brakes completely.
renderer.rootBone = _bones[0];
Transform[] tmpBones = renderer.bones;
for (int i = 0; i < tmpBones.Length; i++)
{
for (int j = 0; j < _bones.Length; j++)
{
if (tmpBones[i].name == _bones[j].name)
{
tmpBones[i] = _bones[j];
}
}
}
renderer.bones = tmpBones;
I’m using a fbx for the base meshes and replacing the parts with gltf files with the Siccity gltf utility library.