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.
The animation starts out fine. All I'm doing here is rotating the left leg up and back down.
We've moved up a little further. Still going good.
Right about halfway up, the leg spins quickly once around its Y axis.
It spins all the way around and stops back where it's supposed to be in about half a second.
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.