Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Need help with dynamically merging several animation controllers

Discussion in 'Animation' started by Donsky, Jul 7, 2020.

  1. Donsky

    Donsky

    Joined:
    Mar 27, 2014
    Posts:
    80
    Hello, I'm working on concept where you should be able to "build" a character from different body parts with different move sets and bone structure. Hands and legs will change, torso and head will pretty much remain intact when it comes to the animation, but the character does not have to be constrained to be a humanoid (for example, hands can become, let's say, 'tentacle-like' and, in theory, you may have more than two legs, or just something like wheels instead of those). Also, there is a case, when some attack animations will force the character to move forward and there, the animations should be merged or generated somehow. One saving grace is that the parts belong to complete builds that can have their own animators built by hand and the basic abilities like movement, jump, attach and etc are always present and logically consistent (some may have a couple of build-specific actions, but we can ignore them for now).

    I'm currently considering to build the animator with separate "hand" and "leg" layers and create the runtime animator controller with layers from separate body parts. Also, when creating the build, I think to look at all the bones all the parts' skinned mesh renderers need, create a combined skeleton with all the bones and decide the bone structure shape based on the parts that actually are effected by them (for example, size of the hand bones will be picked by the hand renderer). However, I'm not yet sure how to incorporate the cases, when we need the hand and leg movements to sync up for some particular actions like movement+attack combinations and general walk cycles...

    Has anyone worked with a similar case or has some idea how to best deal with the situation? Any help would be appreciated :)
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,555
    I've never done anything like that, but Animancer (link in my signature) would probably make it a lot easier since it lets you skip Animator Controllers and have your scripts play their animations directly.
     
  3. Donsky

    Donsky

    Joined:
    Mar 27, 2014
    Posts:
    80
    Thanks, I'll take a look at it. May solve some of the issues; Bone structure alterations are still kind of a problem though
     
  4. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,555
    The easiest workaround for that is probably to just give the character all the bones you might need.

    Keeping each body part as an entirely separate Animator is also an option, though probably pretty bad for performance.
     
  5. Donsky

    Donsky

    Joined:
    Mar 27, 2014
    Posts:
    80
    Yep, probably will go with that.. But it will not be possible to leave the bones unmodified. Some limbs may be larger than others, even if they share the same basic anatomy.. As for the multiple animator performance, I think I'll still try to create something dynamically during runtime and if that fails, might try using more than one as well... It's only the player character that's supposed to be a compound anyways, the rest will likely be hand made and the performance impact will not be all that significant. Will probably have to force all bipeds to share same leg movement when the hands have effect on posture and create custom behavior for non-bipeds to make them fit the requirement