Using rig for multiple meshes

I have a game where the character’s clothing is customizable. There are about 4 separate meshes making up the character. The character is animated, and the only way I found to animate all those pieces together is to copy the rig into each mesh, and play them all in sync. However, such abundance of animations and rigs negatively affects the game performace, especially when there will be multiple characters in the scene. Is there any way to use only one rig for multiple meshes so to avoid duplication?

1 Like

@mvaligursky any idea if there is an easy way to reference a rigged skeleton to multiple meshes?

If that’s not possible, you could always fake it, read the translation of the bones of the animated model and loop through all the other models → bones and update them to match it (counter intuitive).

1 Like

All meshes should be able to work on a single skeleton - assuming all meshes were exported on the same skeleton, bone orders need to be the same.

to attach a render component to an existing skeleton, you should:

  • go over all mesh instances it has, and set skin property of a mesh to the same skin
  • set a rootBone on the render component to point to the root of the same skeleton

If you load a glb with a single skeleton and many meshes, that’s what it does internally.

2 Likes

Thank you very much, this solves my problem!

1 Like