Search Unity

Swapping heads in an animated character?

Discussion in '2D' started by Marscaleb, Nov 4, 2015.

Thread Status:
Not open for further replies.
  1. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    How can I make certain parts of an animated character swap out for alternate versions while still using the same animation?

    For example, let's say I have a character who is fully animated and I want to swap out the head for a different image to be a different character.
    However, the head already has animations that change out the sprite uses, like a wincing expression when the character gets hurt, a shocked expression for some scenes, version where the head turns away/toward the camera that require a new sprite, and etc.
    So the animation normally makes calls to change the head to a different sprite at specific keyframes, and I want to be able to change the head out for a whole different character, or in other words, have the animation use a different set of heads with the same array of expressions.

    I know it's technically possible; I recall seeing the demo for Spriter do this to show it's full Unity support support. They had a fully animated character, playing different animations that changed out the sprites at key frames, but it could also be replaced with a completely different set of sprites to make a whole new character (using the same animations.) They even showed it swapping out just the head.
    If I recall correctly, they even showed an example where you could press a button to change out the head in the middle of the animation, showing how versatile those changes could be. (Though I don't need to change out design on-the-fly like that; if I can just set up my characters ahead of time that will be fine with me.)

    I want to create multiple character designs (using only aesthetic differences) that all use the same animation. I would especially like to change out the head with some different design. But if the normal animation has keyframes to change the expression on the face, how do I add another layer on top of that where I can have the character use a different graphic set not effected by the animation?
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Bones and sprite swapping are the most logical process for this - imo.
    Here are a couple examples and a couple assets that accomplishes your need. The top two links will be most helpful for you.

    http://forum.unity3d.com/threads/2d-puppet-rigging-tips-tricks.245564/

    http://forum.unity3d.com/threads/fantasy-goblin.362702/
    https://www.assetstore.unity3d.com/en/#!/content/14024

    ?? This really is kinda opposite of what you said you wanted in the first part of your post so I really don't understand this part of the question.
    Since you want to have swappable heads and parts that also use the same animation base (same rig) why would you want to have a head swapped in that is not effected by the animations/rig?
     
  3. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    I mean to have an alternate version.
    Let me try being more explicit.
    Have the artwork for:
    -Character A, normal face
    -Character A, hurt face
    -Character B, normal face
    -Character B, hurt face
    When playing the hurt animation, the character switches to the hurt face for that character. If it's character A, it plays hurt_face_A, and then changes back to normal_face_A. If it's character B, then it plays hurt_face_B, and then changes back to normal_face_B.

    But if I animated that normally through Unity, at least as far as I know how to do, then on the frame where the animation changes the face to the hurt face, it will be the hurt face I set a keyframe for. To have a hurt face for a different character, I would need to have a completely separate copy of the animation that uses the other character's face for the hurt animation.
    But I don't want to do that; I want to have one animation that will just grab the hurt face for whatever character I want.

    The video you show ONLY animates the character by moving pivots. As such, there are no sprite changes saved as keyframes. It does not address my issue. The other tools you linked to do not seem to do this either.
     
    Last edited: Nov 7, 2015
  4. funshark

    funshark

    Joined:
    Mar 24, 2009
    Posts:
    225
    I think you just need to swap Atlas like it was shown in this video ( at 20min )
     
  5. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
  6. SVC-Games

    SVC-Games

    Joined:
    May 21, 2013
    Posts:
    137
    This might help:
    http://forum.unity3d.com/threads/2d-puppet-rigging-tips-tricks.245564/

    Basic idea: Animate gameobjects that act as "containers" of your sprites. That way you just change the sprite.

    IE: You have a GameObject called "Head" which have a son called "Head_Sprite" that is the actual sprite. The hierarchy might get a bit more complicated but it will help you a lot down the road.

    Then it's just a matter of changing the animations of the Head_Sprite
     
    theANMATOR2b likes this.
Thread Status:
Not open for further replies.