I figured out a fix.
I think this is a rather wide-spread issue that you’d come across in development, and there definitely are different ways to fix it, but I didn’t really see anything much online other then complete system overhauls, so I took some time and figured it out.
The problem Analysis:
When does this issue occur? When walking straight backwards with an interp time > 0
Why does this occur? Because the angle jumps around from 0 to 360 or from -180 to 180.
Given those 2 facts, the first course of action is to prevent the character from moving backwards at all.
“But i want to keep moving backwards” I hear you screaming…
Of-course you do. You just can’t expect the engine to make it happen for you.
Step 1:
Make a nice and quick backward walking blend-space 1d with just speed. (unless your other aims glitch too, you should be able to adapt this).
Step 2:
Get rid of the backwards within the other 2D blend space
Step 3:
Get into your state and create a new internal state machine, as well as the following states:
Idle (state in picture), Forward and Backward.
Step 4:
Populate the states with your blend space and animations.
NOTE: Idle contains the same Blend Space as Forwards. Backwards contains the 1D walking back anim.
Step 5:
Compile and get the transition errors, then set up the states as follows:
Anything going to forward (notice it’s AND):
Anything going to backwards:
Getting back to idle if Speed <= 0
Test and adjust the variance from ±135 to ±145 if needed.
End result:
Remember this, because the issue is only really happening when walking backwards your grace angle can be rather lax and still allow for the animations to interpolate smoothly.
Doing this you can change the interp time between the rules from forward to back to match the same transition time of the blend-space without having issues.