Search Unity

Character Animation - Bent knees and bobbing using Foot IK

Discussion in 'Animation' started by fineman, Jan 14, 2014.

  1. fineman

    fineman

    Joined:
    Mar 23, 2012
    Posts:
    19
    We have recently brought some animations into Unity and using mecanim to animate our humanoid characters. The animations were designed for the character and mostly look good. We use the Unity humanoid rig. However, if we leave 'Foot IK' unchecked we find that the pelvis of the character stays put and the rest of the body animates around it. We fixed this by checking 'Foot IK' which plants the feet firmly, but then the character tends to have slightly bent legs and bobs and sways as if compensating for its shift in center of gravity.

    Question is, how can we get our animations to play back exactly as they looked in 3DS Max? Ultimately we'd like to use Foot IK for walking up slopes etc.
     
  2. fleshtheworld

    fleshtheworld

    Joined:
    May 26, 2011
    Posts:
    126
    I assume mecanim is built to do that. I am not sure if you have any other options. Mecanim does a bunch of things for you and even offers options but they all require and restrict a bunch of things upon you. Well maybe I just dont know how to use mecanim. But I have yet to see any demonstration of a non mecanim/mixamo / unity representative using mecanim and showing its potential and power especially with using with costume content, etc. All I have seen is the same exact mecanim content. Maybe Im just getting too old and not catching on to new stuff anymore.

    A question concerning your problem is did you animate your rig in place (treadmill method) or into the world (CG method)?
     
    Last edited: Jan 15, 2014
  3. fineman

    fineman

    Joined:
    Mar 23, 2012
    Posts:
    19
    Ooops.. sorry missed your reply - thank you. I am still struggling with mecanim - seems incredibly easy to get in a right mess with it in terms of avatars, mappings and animations. Hands seems to be a permanent nightmare. As for the bent legs, still no solution found. IK all off, everything off and nothing involving humanoid rigs allows the original animation to play without being messed about by mecanim. Pity.

    We animated outside and brought the animations in as FBX.
     
  4. 3DCWCURTO

    3DCWCURTO

    Joined:
    Dec 30, 2012
    Posts:
    19
    Is your root hip bone in 3d max moving up and down or sideways as the character walks? Normally ppl will animate their characters to rise and lower during a cycle. If you use the hip as a root bone Mecanim will turn this root movement into the whole character moving around which isn't desirable.

    Foot Ik crouching sounds like a scripting problem. You should be drop the character the average difference in height between feet so if going forward up a hill you wont crouch, but sideways across a hill one leg will bend and the other be extended.
     
  5. Sebastianphi

    Sebastianphi

    Joined:
    May 18, 2013
    Posts:
    2
  6. TheCCJ

    TheCCJ

    Joined:
    May 2, 2013
    Posts:
    71
    As sepbastian alludes to, you want to make sure you set the Root Position settings in Mecanim are set properly (I usually go with Original, if I know I animated them to look a certain way). Check these and play with them a bit to see if you get the desired effect -- it's not an IK issue necessarily, but how the systems are playing together.

    Also, make sure you have a root node that exists separate of the pelvis, rather than using the pelvis as your root. This tends to alleviate quite a few issues.