Home Technical Talk

Animating Models with Component Design

polycounter lvl 9
Offline / Send Message
apollo580 polycounter lvl 9
So I need some advice on animation. I have a character with attachable parts like a backpack, gloves, helmet, etc. How do I go about animating this guy? Do I have to animate every combination of item or how should I do it? I want this to be simple and cant figure out the best way to quickly animate several animations and just add or remove parts.

Replies

  • Eric Chadwick
    Options
    Offline / Send Message
    In most games, these parts are added/removed in code. The rigger adds attachment points (little bones) to the character rig where various things should appear (weapons in hands, backpacks, armor, shoes, etc.). Then each piece is also given one or more attachment points, and some info about which attachment points on the characters it can be matched with. You carefully rotate and position these points to make the pieces match up with the character. The game code loads/unloads pieces according to gameplay, player input, character customization, etc.
  • RN
    Options
    Offline / Send Message
    RN sublime tool
    The skeleton of your character forms a hierarchy, and you can insert and append other objects to that hierarchy, and when the skeleton plays its animation these objects will follow the bones that they are attached to.

    In most engines you can modify this hierarchy dynamically, with programming. In Unity, for example, you retrieve the transform of the bone that you want an object to follow, and call the setParent method of this object with the bone transform as the argument.

    You'll discover through experimentation that there are alignment matters to take into consideration, like Eric said.
    In order to attach a sword to a hand, you first need to prepare a bone in that hand that will point in the direction you want the sword to point. Then you can parent the sword, which should have a null \ identity transform, to this attachment bone. Then when a "swing" animation plays, the sword will follow and tilt with the hand as if the character were holding it.
    The benefit of this is that you can replace the sword with other objects, such as a bat, a wine bottle, a banana etc. and use the same swing animation for them all.
Sign In or Register to comment.