- Home /
Leg snapping backwards on one frame in a 2D blend tree
Hello!
I was noticing a problem with my character. For one frame during the forward walk cycle, his leg snaps up like he's kicking his own butt. This is only when my forward variable (between -1 and 1) is set to around 0.6. After that is set to the right amount, he kicks hit butt. Can anyone relate to this issue? How can I fix it?
Animation file:
https://drive.google.com/file/d/0B2ZiQtohl3tmVU85Z09teEcybFU/view?usp=sharing
Have you frame for frame synchronised the footsteps in the animations of your blend tree? Usually RiverDance-BandyLeg is caused by badly blending animations.
The other thing that causes this is Not Unturning your limbs in Blender. 360 != 0 degrees .
This means that when you rotate a limb in Blender, if the animation loops back to the start you will end up with the limb, at some point, flicking itself around 360 degrees, so be careful when copy/pasting bone rotations.
In Blender, go frame by frame through your animations. You $$anonymous$$AY find that there is one frame which looks super-weird compared to the rest. $$anonymous$$eep your eyes on the Properties pullout (+ on right hand side of viewport). You may notice that the W factor suddently changes for no good reason.
The left leg lifts higher than the right. If you have mirrored your other anims this may cause an issue.
@meat5000 I just checked for strange rotations, According to blender I don't seem to have any weird twists. But I uploaded the FBX for texting in Unity.
You need to watch the numbers in the properties while manually stepping through the animation. If you find nothing there, the trouble is with a bad sync in the BlendTree or possibly not enough keyframes. Unity likes to strip them out and make its own judgement. Check the error values in the Animation Import tab.
And here's something you need to know.
The FPS setting in the Render tab in Blender has a function in Unity. This will decide the actual FPS of your animation. Currently you have it set to 24FPS which is good for a film but not good enough for a game. Set it to 30 or 60.
@meat5000 I tried turning off animation compression completely and that didn't help.
Its worth checking when you have these errors.
Do the footsteps of each animation all fall on the same frame?
Now that you mention it, the idle animation is shorter than the walk, so that might be a problem.
@meat5000 I don't use separate layers. I'm using a blend tree in the same layer.
EDIT
Sorry just reread your comment. How can I use layers when the toes are involved in the idle?
Only Blend Like animations.
Only place anims with footsteps in the same tree. For example, run walk, turn left, turn right. The steps must fall in the same frames.
For other things which WILL still affect the bones, use separate layers to control their influence. An idle anim will still interfere with a walking stride.