Hello all. First of all I just wanted to say that we’ve been using Unity3D for our project and we’re impressed with mecanim and Unity3D as a whole.
We have prototyped our character and we thought we had the hang of how mecanim works. Now I’ve started organizing the 3ds max main character file so I can do the final version of the animations, but I’ve discovered a problem I can’t get around.
I have several animations for my 3D game, for example:
- no root movement sequence: idle (loop), idle jump (non-loop), idle falling (loop) and idle landing (non-loop);
- Z root movement sequence: run (loop), run jump (non-loop), run falling (loop) and run landing (non-loop);
The blending between these is managed by mecanim’s blend tree, driven by the character’s forward speed.
I have made a custom bone rigged character as CAT is too buggy and biped is… old. I have managed to get great looking facial animation using nothing but a few bones and all animation is exported perfectly to Unity3D. edit: scratch that, not all facial animation is being exported. edit2: It now works, I just had to click “fix mask” on every clip.
The rig’s hierarchy at the top is:
- “scaler control” (this is the parent of all the rig and is where I animated the root movement →
- child of scaler control: “general control” (this is for when I want to move the character, but not affect root movement it turns out I’m not using this much) →
- childs of general control: head control, hand control, foot control, etc, and hip control →
- child of hip control: bone_pelvis (the actual bone mecanim recognizes as part of the rig)
Animation type is humanoid and every bone is correctly mapped.
On animation clip - motion - root motion node I have “none”. If I choose the scaler controler for this, the character rotates 90º and faces down on the ground.
The problem:
I figured I had to tick “Loop pose” on every clip because that’s how root motion worked and that’s how we tested. But that was obviously creating serious animation artifacts on non-looping clips. So I don’t want to loop pose on those clips but if I don’t, unity3D duplicates the result of the root motion to the body transform, as a child of the root transform, resulting in the character moving twice as much as it should and getting off of its correct transform axis.
image 1: loop pose ON. The root motion works, but the animation can’t possibly reflect how it was on 3ds max. Notice the knee bended awkwardly and the pose being totally different from image 2.
image 2: loop pose OFF. The animation is as in 3ds max, but the root transform moves, and the body transform undesirably moves too.
Solutions I’ve considered but are problematic:
- Making only looping animations when I need root transform: this is impractical, my game needs non-looping animations.
- Making the character’s root move half as much on 3ds max, so half * 2 = the correct movement I want. The problem with this is that the character gets away from its axis.
With this, the animation production has come to a halt. We’ll continue to look into the problem, but it would be great if someone could spot what we’re doing wrong.
Thanks in advance.