2
\$\begingroup\$

I've been programming games for quite a few years now, but I recently thought I would try my hand at some simple 3D modeling and animation. I'm currently using Unity and Blender. In Blender, I was able to make a model and animate it using bones without too many issues. I created an extremely simple walking animation for my basic character I modeled. However, when I import it into Unity, the left leg always does a weird rotation around its Y axis halfway through the animation. All the other parts work just fine. I messed with it forever trying to fix it. Eventually, I created a whole new skeleton from scratch, and it's still doing the exact same thing. I've exported it in every format that Blender/Unity support and the issue persists. I've included some screenshots below to better describe my issue.

enter image description here

The animation starts out fine. All I'm doing here is rotating the left leg up and back down.

enter image description here

We've moved up a little further. Still going good.

enter image description here

Right about halfway up, the leg spins quickly once around its Y axis.

enter image description here

It spins all the way around and stops back where it's supposed to be in about half a second.

enter image description here

Then it continues on normally until it reaches the top. One the way back down, it does the exact same thing at the exact same spot, just in reverse.

My animation in Blender plays perfectly and is very simple. It's just a rotation on a single axis over 60 frames. The screenshots are from my most recent attempt (I've done this animation at least a dozen times now.) So all I did was just try animating the left leg and nothing else.

This never happens with any other bones. The right leg animates perfectly, the arms animate just fine, etc.

Any help would be greatly appreciated. Like I said, I'm very new to all of this. This is my first attempt at modeling and animating. I apologize if I missed something obvious. I've been Googling for an answer to this issue for two days now.

\$\endgroup\$
2
\$\begingroup\$

I figured out how to fix this, but I'm still not entirely positive what the actual problem was. My rotation was very simple and was only in the X axis. The Y and Z axis remained at 0 throughout the rotation. However, if I manually type 0 into these boxes (even though they are already 0) the weird rotation problem goes away. This is repeatable. If I don't manually type 0 into the Y and Z axis of the rotation in the animation, it will do the weird rotation in Unity. If I do type 0 into the Y and Z axis, the animation plays perfectly in Unity. I confirmed this several times and it works, but I'm not sure why.

So, I solved the problem, I'm just not sure what was actually causing the problem in the first place.

enter image description here

\$\endgroup\$
-1
\$\begingroup\$

Are your keyframes in all 3 rotation channels? Try Ctrl+N in edit mode for the bones. Good luck.

EDIT:

are your rotations set to global or local? when you press i to enter a keyframe are you selecting locRot or Rotation?

Whichever one you are using, try the other one.

\$\endgroup\$
  • \$\begingroup\$ Can you elaborate on your answer at all and give the asker more detail on why all 3 channels are needed etc? \$\endgroup\$ – Tom 'Blue' Piddock Jul 3 '14 at 11:12
  • \$\begingroup\$ I tried both "Whole Character" and Rotation. I'll try locRot when I get home from work today. Thank you for the suggestions. \$\endgroup\$ – Tom Jul 3 '14 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.