Unity – Companion AI with NavMeshAgent causing jittery movement on the X-Axis

I’m trying to do a companion AI that follows around my player but with a certain distance. I first tried to self-program the movement behavior. but realized quickly that a NavMeshAgent offers more simple solutions to what I’m trying to archieve.

Now the problem is that my AI doesn’t follow around smoothly. It’s surely not because of the camera, since my player and my enemy AIs do not have these jittery movement. My script is as simple as it can get:

private Transform target; private NavMeshAgent agent;  public Animator partnerAnim; public GameObject player;  private void Start() {     // set target to player transform     target = GameManager.GM.playerMachine.transform;     agent = GetComponent<NavMeshAgent>(); }  private void Update() {     // Determining wether to play the walk animation or not     partnerAnim.SetFloat("normalizedSpeed", Mathf.Clamp01(agent.velocity.magnitude));      agent.SetDestination(target.position); } 

My stopping distance is at 2 and my speed is at 3.5. No matter how I change these values, the jittery movement won’t change.

I also have a rigidbody attached to my NavMeshAgent, and I made sure to turn on "isKinematic", and I also removed it to check if that solves the problem, but it didn’t.

The weird thing is that it only seems to be a problem when moving along the X-Axis. When I move on the Z-Axis only, my partner is following my player smoothly (I’m guessing this is because I increase the speed of my player on the Z-Axis, but I don’t really see the connection with my problem here. If it would be a speed problem, then lowering the speed on my AI would’ve fixed this, but it didn’t.)

Here are the full NavMeshAgent settings.

If you have any guesses please let me know. Thanks in advance!