Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Resolved Disable Mecanim humanoid foot automatic placement

Discussion in 'Animation' started by charly_vb, Feb 20, 2023.

  1. charly_vb

    charly_vb

    Joined:
    Aug 11, 2022
    Posts:
    2
    Hi,
    I've recently started playing with the humanoid stuff built in Unity, mostly to benefit from the retargeting possibilities.
    Overall everything works great, however, there is one issue I cannot wrap my head around. Despite the fact that the IK pass is disabled in the anim controller, the "Foot IK" is unticked in the animation clip, and the animation import parameters are specifying "Original" for Y root motion, Unity still "snaps" the Toes bone to the floor, and messes with the Y root motion.

    To illustrate the issue, here is a picture of the rig for the feet upload_2023-2-20_15-44-0.png
    And here is how the same foot gets positioned during a walk animation. Hopefully it is clear that the foot gets inside the ground. You can also notice the penetration of the ground for the right foot (which does not happen in Blender, the foot is always properly over the ground).
    upload_2023-2-20_15-47-41.png
    There is root motion in the animation, with the Y always at 0. The animation is properly taking the "offset" of the shoe sole.
    If I import the animation using a generic rig instead of the humanoid, the root is never touched by the animation and the feet are properly never touched either.

    There is no physics involved here.
    I've tried playing with the avatar mask and the root motion node, without success (disabling the feet IK in the mask do not seem to do anything, while setting the motion node to "Root" instead of "None" basically breaks the motion (XZ position gets back to 0 at the start of each new animation cycle)

    So basically, my question is, is it possible (and if yes, how to), have the animations behave "as-if" they were in generic mode, mostly, is it possible to avoid having Unity touching the root Y and the feet position of my humanoids?

    Thanks in advance.

    P.S. I'm using Unity 2021.3 if that might be useful.
     
    Last edited: Feb 20, 2023
  2. charly_vb

    charly_vb

    Joined:
    Aug 11, 2022
    Posts:
    2
    As it appears, the problem is probably mostly due to blender fbx export which does stuff I apparently don't understand.

    Unity still adds some root motion that is not present with the generic rig, but at least this one can be controlled in a more understandable way (using the animation import settings).

    So, problem is not solved per se, but it's not a Unity issue. Key takeaway if people happen to find this post in the future, double check your fbx animations (reimport them in blender after export).
     
  3. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    666
    as I understand, unity calculates humanoid root position from hip.
    what you can do: try exporting out the animation with a skeleton root node at feet position

    The Root Transform is a projection on the Y plane of the Body Transform and is computed at runtime.

    https://docs.unity3d.com/Manual/RootMotion.html

    Generic Root Motion and Loop Pose
    This works in essentially the same as Humanoid Root Motion, but instead of using the Body Transform to compute/project a Root Transform, the transform set in Root NodeA transform in an animation hierarchy that allows Unity to establish consistency between Animation clips for a generic model. It also enables Unity to properly blend between Animations that have not been authored “in place” (that is, where the whole Model moves its world position while animating). More info
    See in Glossary is used. The Pose (all the bones which transform below the Root Motion bone) is made relative to the Root Transform.

    if it is just height difference (in the picture it seems the ground level is at foot toe joint position)
    you can adjust height in animation's root transform position (Y) settings like -0.02 or similar
     
    Last edited: Feb 21, 2023