OnTriggerEnter2D Problems. Not working.

I am new to Unity and I am trying to make a script that switches me to the next scene when I collide with the object, and it is not working. I’ve been searching everywhere for an answer for over an hour and I can’t find anything that helps. Here is my code:

void OnTriggerEnter2D (Collider2D other){
if (other.gameObject.tag == “next”)
{
Application.LoadLevel (“Level2”);
}
}

No, it is not called “Collider.cs”.
If anyone could help I would really appreciate it. :slight_smile:

Did you check the “IsTrigger” field of the collider in the inspector?

Does the other object have a collider too?

Does any of them have a RigidBody2D? For OnTriggerXXXX methods to be called at least one of the objects colliding has to have a RigidBody (for 3D and 2D versions of the methods).

Is the collision between the layers of the 2 objects checked in the physic’s collision matrix? Unity - Manual: Layer-based collision detection

If none of those questions helped share more info, describe the objects colliding and maybe share some screenshots of the inspector when selecting them.

Nevermind, the problem was something very dumb. When I created the shape I thought that it automatically put a 2D Box Collider on it, but it actually put a 3D Collider, and I did not notice. Thanks for trying to help me @DiegoSLTS