Search Unity

An Animation problem and details of my debugging

Discussion in 'Animation' started by Vasir_, Oct 7, 2013.

  1. Vasir_

    Vasir_

    Joined:
    Jan 5, 2013
    Posts:
    13
    Hi, so I have an animation problem that's been frustrating me for a few weeks now. This is my detailed debugging step by step. This is also weeks working off memory, so bear that in mind. I'm a programmer, by the way. Not the animator.

    When I first used mecanim I watched the Unity tutorial, and downloaded their assets. I followed the steps http://www.youtube.com/watch?v=Xx21y9eJq1U
    here without problem. This was a great video and it brought me a deeper understanding of animation. I understand how the tree works and how to move from running to idle to jumping and all that.

    Now here's where my problems begin.
    My animator handed me the model of our character. He doesn't know how to rig it himself, but he bought software that will auto rig for us.
    So he hands me this rigged model and presto, I place it into the game! I set the model to humanoid and clicked configure. The bone window comes up, I make sure to set it in T pose and all that. Click apply.
    Next, I made the animator controller, produced an idle animation myself from the walk (really just pulled it to a single frame when the user stops moving, since my animator didn't have an idle made at this point.

    Awesome! It works. Only I had to turn root motion either on or off for it to work (opposite of the tutorial, I remember that much.) Other than that it was stopping and walking when I moved forward. I was happy.

    Then my animator... "The hand isn't moving, and the leg is glitching!" Okay, he isn't happy. I'll try this again. He sends me a new model.
    I repeat the auto mapping and T pose and he, once again, is disatsified because of a leg glitch.

    At this point I taught my animator how to use Unity and, following the tutorial, was able to learn how to map bones.
    It was at this point when he realized Unity auto mapped the bones incorrectly. I had a sneaky feeling it was because of the bone structure names due to his software, but he doesn't rig himself, and I didn't want to tell him to do it over.

    Finally I have him play around with it and, after baking in the animation (to Maya) the leg glitch is solved. Yay! His fix was to keep it in legacy and bake it. OK. (Edit - I should point out that I had him map the bones entirely by hand, correctly.)
    I bring it back into Unity and... oh no. The animation will not loop. Nothing I do will make my walk animation loop. Furthermore I cannot remake a single frame "idle" placeholder because it is based in.
    But, I'm a resourceful guy. Inside the animator controller I placed the baked take, duplicated it. I placed a transition in and out of the two single play walks, and they loop nearly perfectly. I know this is very hackish, I know.
    However at the end of the day, I cannot get this animation to move at ALL with this (whether root animate is on or off) - and I suspect the lack of proper looping is an indication of a bigger problem.

    So, this is my thought process. I've put off posting this for a couple of weeks because I've been so mad, and I've googled anything I could think of "animation won't walk." "legacy won't move" "baked model won't move" Nadda.

    Do any of you fine gents have any suggestions of what I could try?
     
    Last edited: Oct 7, 2013
  2. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    You can try Mixamo's AutoRigging. Well before they start charging you to use it. You can also assign the bones manually when configuring the avatar if something is messed up with the names. Since it lists all the bones there on the side, just verify which bones are which if you want instead of relying on Unity to do it.
    You should be able to adjust the animation in the fbx file that it is in and set it to loop. It doesn't matter if it is a in-place or root animations. Loop Pose is an option for the animation before you get into the Cycle Offset, Root Transform Rotation, etc.
    If you have a in-place walk cycle, you are going to have to write code to make it work. Just like you would before Mecanim. http://docs.unity3d.com/Documentation/Manual/ScriptingRootMotion.html
    that is a start of what Unity tried to do with working with in-place animations and Mecanim.
    Hope that helps. let me know if it doesn't.
     
  3. Vasir_

    Vasir_

    Joined:
    Jan 5, 2013
    Posts:
    13
    I had my animator map them correctly, since I didn't know what any of the bones were.
    When you say adjust the animation in the fbx file and set it to loop, do you mean Maya or Unity? Because I have loop checked off and it works with the previous models, (which were not baked) but it won't loop the baked model.
    $Anim_Inspector.jpg
    This is the inspector.
    I believe I fixed the movement issue, however would baking a model prevent it from looping?
     

    Attached Files:

    Last edited: Oct 7, 2013