Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

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,534
    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! :)