Search Unity

Equip Armor and following animation

Discussion in 'Scripting' started by Gousenfire, Jan 29, 2015.

  1. Gousenfire

    Gousenfire

    Joined:
    Feb 18, 2014
    Posts:
    30
    Hello World,
    I made an inventory system and the character panel to my game and now i have to equip the items in the inventory on my character panel, so far, so good. But I cant find a way to when i Instantiate a GameObject of the armor the current armor follow the players animation. How do I do this?

    E.g.: I equipped the leg's armor. And when my character walk, the leg's armor should follow the walk animation.
    Thanks anyway,
    Gousenfire

    Ps: I'm using the last version of Unity, and also last version of Blender (to make the item's models).
     
  2. Kamalen

    Kamalen

    Joined:
    Dec 27, 2012
    Posts:
    29
    If you just want your armor to follow your player, place the armor object as child of the player. That way, then the player moves, the armor moves with him.

    However, if you're talking about real animations (like armor legs following player legs), you will have to animate the armor and make sure the good animation is played on both objects.
     
  3. Gousenfire

    Gousenfire

    Joined:
    Feb 18, 2014
    Posts:
    30
    there's no other way to easily doing that by skinned mesh renderer?
     
  4. mathias234

    mathias234

    Joined:
    Sep 9, 2012
    Posts:
    239
    What I usually do is to just replace the texture on the player for the parts that needs to bend but for shoulders i would just instantiate it to the bone
     
  5. CodeMonke234

    CodeMonke234

    Joined:
    Oct 13, 2010
    Posts:
    181
    you can attach an object to as a child of one of the bones of the skinned mesh - e.g. attach a helmet to head or a sword to hand.

    But for a full suit of armor might be best to have its own animation, due to the potential for cracking at seams and such
     
  6. Gousenfire

    Gousenfire

    Joined:
    Feb 18, 2014
    Posts:
    30
    Thank you guys. I'll make the animations for the armor!