Search Unity

Problem with foot sliding of my character from Maya to Unity using legacy rig.

Discussion in 'Animation' started by Yuzrass, Mar 10, 2015.

  1. Yuzrass

    Yuzrass

    Joined:
    Mar 3, 2015
    Posts:
    5
    Hi, everyone! I've had basic experience with Unity back in version 2 and 3 then left it for some time. I am a 3D artist and using it for game art asset and I am not good in technical and programming areas. Now that I stared back with Unity 4. I realize that Unity got a new animation system Mecanim. I've been digging into it this pass few days and found it quite cool!
    Now the problem that I am facing is what if I or someone need to use the legacy rig instead of Humanoid Mecanim? When I tried setting my character up for Legacy rig. I found one thing that annoys me which is the foot or leg bone seems to slide and glide on the floor and not stay solid planted on the floor like how I animate and bake it in Maya. I had not of this problem when I am using Mecanim because Mecanim have the 'Foot IK' feature.
    Is this a common problem or a natural thing happen when using Legacy rig or am I doing it wrongly on my side?
    To make it easier to show you my problem, you can look at the video that I have recorded bellow. Hope you can shine some light. Thank you.

     
  2. Yuzrass

    Yuzrass

    Joined:
    Mar 3, 2015
    Posts:
    5
    I would also want to ask. This time for Mecanim animation, do we have to provide the animation cycle for the character not in-place like how we normally do it? For example, for walk cycle, instead of having it walk in-place, do I need to make it walk forward in space? Or it doesn't matter, I can do both?
     
  3. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    For your original question - to get the feet to not slide, the animation timing of the root node has to move the same distance and speed as the feet each step. This keeps the feet from looking like they are sliding. It's all about timing.
    If the root node is moving faster than the foot - the foot will look like it is sliding/lagging. If the root node is moving slower than the foot - the foot will look like it is sliding/skating.
    Not sure if Legacy has some 'code' way for IK foot locking.

    For your second question - mecanim supports both in-place animation and root motion. You can do both, and choose your preferred method.

    Best to check out some of the learning material regarding mecanim and animation.
     
    Mecanim-Dev likes this.
  4. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
  5. Yuzrass

    Yuzrass

    Joined:
    Mar 3, 2015
    Posts:
    5
    Thanks theANMATOR2b for your reply. "to get the feet to not slide, the animation timing of the root node has to move the same distance and speed as the feet each step." Are you referring the sliding when walking? I think what you mention here makes sense if the character is walking or running. As in my video example, my problem is during Idle stand, the foot seems sliding a little which is so much different from the animated version in original Maya file.

    Thanks Mecanim.Dev for pointing on the Locomotion system, but my main concern here is to find out what I'm doing wrong or is it the Unity error that everyone go through and had to fix this in a script. For my bone setup, the Hip bone is the root of all bones and is parented to the circle spline controller. I think that is very standard right?
     
  6. Yuzrass

    Yuzrass

    Joined:
    Mar 3, 2015
    Posts:
    5
    Hi guys! Been a while. I found the solution to by foot sliding problem. There is nothing wrong with the rig and animation in Maya. As in the video, I already baked all the keyframes of the animation as 1 keyframe per frame. Now the problem happen when I import it in Unity. By default, when you switch to Legacy, the Anim Compression is set to Keyframe Reduction. So I figured that Unity automatic Keyframe Reduction is the culprit when trying to reduce the keyframes. So I turn Off the Anim Compression and Presto! No more sliding foot! :D.

    Now one question left. Will it make the game heavy if all the bones have baked keyframes on each frames with the no Anim Compression (Off) or will it just gives a very small hit on the performance?
     
    jordaniveson and borbs727 like this.
  7. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    I knew it was a simple fix - but I couldn't remember which check/uncheck it was so I was silent. Glad you found it.
    Not sure regarding the performance hit on the baked keys. But unless you have dozens of characters with similar setups I wouldn't worry about it, until you start seeing problems. Since you have a working pipeline now, work on the game. Don't worry about performance of the finished product.
    Of course I've heard say - it's important to worry about optimization/performance early rather than later, but I think it's more important to focus on gameplay and "just getting the darn thing to work like it should"! :) After game play is tight and working like it should, check into performance if there are noticeable hits.
     
  8. Yuzrass

    Yuzrass

    Joined:
    Mar 3, 2015
    Posts:
    5
    Ya! that makes sense. Although, I'm not planning to make games with Unity. Maybe in the future I would, when I am good with Playmaker or something as I am mostly 3D Artist rather than Technical programming wizard. My intention is to provide and sell 3D game asset in the Asset Store. To ensure my assets posses quality, I need to do some RnD a long my process. So any sort of variable must be eliminated to provide error free assets :D.

    I think I can declare this thread to be SOLVED!