Search Unity

Question Animate character with dynamic kinematic targets

Discussion in 'Animation' started by Veinemoinen, Feb 24, 2021.

  1. Veinemoinen

    Veinemoinen

    Joined:
    Sep 17, 2020
    Posts:
    2
    What is the best way to animate all body segments and joints of a character, but where the target animation changes often and is not predefined?

    I'm implementing motion matching, but I'm relatively new to animation in Unity. I'm comfortable with the theory behind motion matching and have the motion capture data needed, but I'm uncertain to how to implement real time animation. This animation problem has the following characteristics:
    • There's a database of approximately 15 mins of motion capture.
    • As an animation is playing, the character will need to jump to different points in the animation database and play the motions from that point based on user input.
    • A custom blend will need to smooth out discontinuities, so whatever's driving the animation will need to also process the animation data. I'd like full control of this blending.
    • I only need to animate one character.
    My impression is that almost all of the kinematics of the animation needs to be controlled via script.

    What might be a reasonably easy/robust way of animating this character? I'm aware of using the animating rigging package to manually set joint centre positions or segment orientations. This could be done with multi-parent/multi-orientation constraints. However it doesn't feel like the rigging package was made for controlling a character in this detail.

    I'm not really familiar with the playable API, however that feels like it should be suitable for this task. Can a playables based implementation dynamically control e.g. elbow angles or position? If yes, could someone point towards a good resource for learning more about this? All tutorials I've found about playables focus on timelines and event signalling.

    I'm also happy to hear about any other approach that would be a good idea to take.

    Bonus points if, on top of the dynamic animation of the character, one could apply constraints such as preventing foot-sliding.