Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Humanoid root motion with additional non-humanoid bone.

Discussion in 'Animation' started by dinnes, Sep 17, 2015.

  1. dinnes

    dinnes

    Joined:
    Mar 25, 2015
    Posts:
    6
    Hi,

    I'm trying to come up with a solution for an animating humanoid interacting with an external object, and I am using unity's built in humanoid root motion to update the transform of the character while it's animating. What I'm trying to do is have a non-humanoid bone (lets call it the prop bone) that is parented to the character's root, and is included in the same animation clip. I'd like to use this bone to position an external object so the object reacts realistically in conjunction with the character animation. Unfortunately, when root motion is enabled, the prop bone isn't adjusted in the same way that the character's bones are. The root motion causes the prop bone to behave differently than originally authored in the animation, it rotates and translates along with the root, rather than staying relative the character it was authored against.

    I'm wondering if there is a way to include a prop bone in unity's root motion "adjustment" of the animation, so that it stays relative to the character.

    I've considered parenting the prop bone under one of the humanoid bones, say the hips, for example. But this would cause the bone to have to be "counter animated" to compensate for the character's motion.

    I've also considered separating the two animations and applying the prop animation separately to the prop, rather than having the animation data live in the same clip, but I'd rather have the animations consolidated if possible.

    Any thoughts/advice appreciated!

    Thank-you.
     
  2. dinnes

    dinnes

    Joined:
    Mar 25, 2015
    Posts:
    6
    Update;

    I got this working by writing a maya script to parent the prop bone under the hips, while maintaining the world space animation. Once I did this Unity picked up the bone in it's root motion adjustment. Must have something to do with being under part of the skeleton that Unity considers humanoid.
     
    theANMATOR2b likes this.
  3. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    That's cheating! :)
    Glad you found a solution.