OnTriggerEnter not triggering. (Solved!)

Hey everyone and thanks in advance for trying to help.
Lets start:
I am making a 3D racing game and started adding AI Cars and I am currently trying to make them follow a path.
I have an empty gameobject which holds a collider (And has Is Trigger enabled.)
My cars also have Rigidbody’s but despite this the AI car just goes through the collider and starts to spin in circles. (The AI script is courtesy of Unity’s Asset Pack.)
My script to change to the next waypoint: (The debug message does not show!)

using UnityEngine;
using System.Collections;

public class WayPointTest : MonoBehaviour {

    private GameObject AiCar;

    private Transform Checkpoint1;
    private Transform Checkpoint2;

    // Use this for initialization
    void Start () {

        AiCar = GameObject.Find ("AI 1");
        Checkpoint1 = GameObject.Find ("Checkpoint 1").transform;
        Checkpoint2 = GameObject.Find ("Checkpoint 2").transform;

        AiCar.GetComponent<UnityStandardAssets.Vehicles.Car.CarAIControl> ().m_Target = Checkpoint1;
    }

    // Update is called once per frame
    void Update () {

    }

    void OnTriggerEnter (Collider check)
    {
        if(check.gameObject.name == "Checkpoint 1")
        {
//            AiCar.GetComponent<UnityStandardAssets.Vehicles.Car.CarAIControl> ().m_Target = Checkpoint2;
            Debug.Log ("Trigger entered!");
        }
    }
}

If there is another, easier way to add AI to my cars than please feel free to let me know and any help would be appreciated.
Thanks.

EDIT:
The line to change checkpoints in the OnTriggerEnter fucntion is supposed to be commented out. Also, the first checkpoint get applied to the car at the start successfully.
If you need anything else just ask and I will get back ASAP.

So, do you see the debug message when the AI object passes through the checkpoint? I’m not sure I understand what the issue is.
If you comment out the line that increments to the next checkpoint, the AI will always travel towards the same checkpoint, which is why it will go in circles after passing through.

No the debug message does not show.
Sorry for not mentioning. added to my post.

The car must have a Collider in addition to the Rigidbody and it cannot be IsTrigger.

Put a debug line outside of the if statement in OnTriggerEnter, and see what’s happening.

Debug.Log (check.gameObject.Name);

If I can make a suggestion, I think it would be better if you made a script for your checkpoint objects and did the OnTriggerEnter within that script instead of having it in a script attached to the AI objects.

Dang sorry again, I have it on a AICheckpointManager empty object.
EDIT: Still nothing for the debug log message.

Yeah I tried putting a collider on the cars main object and still didnt work.
Thanks for the suggestion though.

Try putting a rigidbody component on your checkpoints and see if that makes a difference, uncheck useGravity.

Also if you have that script on an empty game object without a collider, nothing will trigger it. You should make a “checkpointTrigger” script that you attach to all your checkpoints, which would simply have a OnTriggerEnter, and then you should call a public function from your AICheckpointManager script that will handle whatever you need it to.

Edit:
On line 28, you’re checking to see if the triggering collider is the checkpoint itself, I believe you want that to be something like

if(check.gameObject==AiCar)

OMG It just hit me.
Thanks you!
Your edit is completely correct!
I was checking to see if the checkpoint was colliding with itself! Derp
THANKS!