Ai agent navmesh with animation issue

So i have the following blend tree:

Then i have the following code:

Vector3 move = Target;
if (move.magnitude > 1f) move.Normalize();
move = transform.InverseTransformDirection(move);
CheckGroundStatus();
move = Vector3.ProjectOnPlane(move, m_GroundNormal);
m_inputMagnitude = move.magnitude;
m_TurnAmount = Mathf.Atan2(move.x, move.z);
m_ForwardAmount = move.z;

m_Animator.SetFloat("Forward", m_ForwardAmount);
m_Animator.SetFloat("InputMagnitude", m_inputMagnitude);
m_Animator.SetFloat("Turn", m_TurnAmount);

This sort of work but it has a few issues when walking backward it simply swift between the “backward and strafe state”

Can anyone help me out with how I might smooth this even more?

Are you refering to smoothing the animation transition? You could smooth the values you pass into the animator by using the SetFloat version that takes a damping time and delta time. something like :

float dampTime = .25f;
m_Animator.SetFloat("Turn", m_TurnAmount, dampTime, Time.deltaTime);

No the problem is when he moves backwards it seems to strafe so the values are really off somehow

6925952--812738--upload_2021-3-11_21-9-44.png