Search Unity

Sharing animation clips between similar rigs

Discussion in 'Animation' started by LeRan, Jul 9, 2018.

  1. LeRan

    LeRan

    Joined:
    Nov 24, 2015
    Posts:
    118
    Hi forum,

    I'm making a game in which there are several characters with similar rigs, who should be able to use the same animations. The characters, rigs and animations are made in Blender and imported into Unity as .FBX files.

    Everything works fine for the first character, imported with its animations. But importing every character with all animations from Blender seems a waste of time and data, since those animations are the same : so I decided to import only Character A with all animations, and all the rest (Character B, C etc.) with only the rig, and share Character A's animations.

    But : even when Character B is equipped with the same Animator Controller as Character A, nothing happens : no animation clip plays at all, despite the fact the the States in the Animator happen correctly (e.g. the Character B object moves on scene, the Animator Controller displays the progress bar moving in the "walking" state, but Character B objet shows no animation at all).

    As far as I researched, it should work as long as all characters have the same rig with identical bone names, which is the case, so I don't understand what's wrong. Could the problem be that the Character A is imported along with a child object which has its own rig (a coffee cup with one single bone) ? If that's not the problem I'd like to keep my coffee cup...
     
  2. LeRan

    LeRan

    Joined:
    Nov 24, 2015
    Posts:
    118
    All right, I found the solution, here goes.

    The bone names must match, but they must match all the way from the very root of the armature. Examples :
    charaterA_armature>root>pelvis>...>right_hand
    charaterB_armature>root>pelvis>...>right_hand

    ... that will not match, until you rename "charaterB_armature" into "charaterA_armature" so that the whole path is identical.

    I lost a couple days on that but now science knows :/
     
    sirleto and theANMATOR2b like this.
  3. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Props for returning and explaining the solution.

    Alternative - research avatar definition and avatar masking - for the "extra" bones like the coffee cup.