Search Unity

Mecanim and swappable armor pieces

Discussion in 'Scripting' started by Alessio89, Sep 2, 2014.

  1. Alessio89

    Alessio89

    Joined:
    Aug 8, 2014
    Posts:
    20
    Hi! I'm prototyping a third person fantasy rpg with the ability to swap armors. I understand that the best practice is to have different animated models for each part or the body and to stitch them together.
    But every article I find seems to talk about legacy animations.
    What about mecanim? If I retarget the player animation on the armor piece, shouldn't it work? If I place the different pieces on top of the player model and animate every piece with the player's mecanim controller, shouldn't all the piece move correctly without need to stitch them and make animation for each one?

    I won't be able to try it before tonight (not home right now), that's why I ask :)
    I need a cheap way of achieving this, if there's any...

    P.s.: I didn't know where to post this, so forgive me if it's the wrong section.
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    The process is the same. Rig each mesh (e.g., bare chest, cloth shirt chest, chainmail chest, plate chest, etc.) to the skeleton. When the character switches to chainmail, show the chainmail mesh and hide the other chest meshes. The mesh will follow the skeleton's bones regardless of whether you use Legacy, Mecanim, procedural (script) animation, ragdoll physics, whatever.
     
    Alessio89 likes this.
  3. Alessio89

    Alessio89

    Joined:
    Aug 8, 2014
    Posts:
    20
    Thanks for the reply. I in fact found out that it actually works the same for both. That's good to know! :)