Can someone help me understand why my two codes aren't cooperating with eachother?

Hey!
So basically I am making a car game, where I want my AI to follow a certain path. To do this I made one script for the AI and one for the path. However, for some reason the two scripts don’t seem to cooperate with eachother, and I don’t know why.

This is the script for my AI:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;  

public class NPC : MonoBehaviour
{
    public GameObject destinationPoint;  
    NavMeshAgent theAgent;   

    void Start()   
    {
        theAgent = GetComponent<NavMeshAgent>();  
    }

    void Update()  
    {
        theAgent.SetDestination(destinationPoint.transform.position); 
    }
}

This is the script for the path:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;  

public class NPC3Track : MonoBehaviour
{
    public GameObject TheMarker;   
    public GameObject Destination1;  
    public GameObject Destination2;  
    public GameObject Destination3;  
    public GameObject Destination4;  
    public GameObject Destination5; 
    public GameObject Destination6;  
    public int MarkTracker;


    void Update()     
    {
        if (MarkTracker == 0)
        {
            TheMarker.transform.position = Destination1.transform.position;     
        }
        if (MarkTracker == 1)
        {
            TheMarker.transform.position = Destination2.transform.position;     
        }
        if (MarkTracker == 2)
        {
            TheMarker.transform.position = Destination3.transform.position;     
        }
        if (MarkTracker == 3)
        {
            TheMarker.transform.position = Destination4.transform.position;     
        }
        if (MarkTracker == 4)
        {
            TheMarker.transform.position = Destination5.transform.position;     
        }
        if (MarkTracker == 5)
        {
            TheMarker.transform.position = Destination6.transform.position;     
        }
    }
    private IEnumerator OnTriggerEnter(Collider collision)
    {
        if (collision.gameObject.tag == "NPC") 
        {
            this.GetComponent<MeshCollider>().enabled = false; 
            MarkTracker += 1;
            if (MarkTracker == 6)
            {
                MarkTracker = 0;
            }
        }
        yield return new WaitForSeconds(1);
        this.GetComponent<MeshCollider>().enabled = true;
    }
}

Hello. Did you check if OnTriggerEnter is beeing called? Thats the first thing you must CHECK, ALWAYS!

Some things:

In that update, you do:

if MarkTracker == 1
if MarkTracker == 2
if MarkTracker == 3
....

Thats a waste of resources! As every frame MarkTracker can only be 1 of that values, you must do

if MarkTracker == 1
else if MarkTracker == 2
else if MarkTracker = 3

So, when it finds the true solution, it did not check all the others…

Second. I’m 90% sure you cant do Collision functions as coroutines! They are void functions from Unity, you can not transform them…