How can I check which of an object's colliders was touched during a collision?

I my game, I am trying to create a door/loading zone system, in which an Empty GameObject has several loading zones as children, each with triggers as components. Also attached to each of the loading zones is a script that gives details for where it leads. What is supposed to happen is, when the player touches any of the loading zones, a script on the parent GameObject checks to see which of the loading zones was entered, in order to figure out to which other loading zone the player should be taken to. However, I am having trouble figuring out how to detect which of the loading zones was touched.

This is my code so far:

void OnTriggerEnter2D(Collider2D collider)
    if ( == "Player")
        EnteredDoor = Collision2D.otherCollider;

        Debug.Log("enter door");



Most everything seems to be working, except that, when writing Collision2D.otherCollider, an error appears, saying that

CS0120: An object reference is required for the nonstatic field, method, or property ‘Collision2D.otherCollider’

Does anyone know how I might go about clearing this error, or potentially an alternative way to figure out which of the object’s colliders was touched during the collision?

You can’t use collision data in OnTriggerEnter, only in OnCollisionEnter, where you would receive a Collision object as parameter. But that would mean that there is an actual physics collision, which you don’t want in a system like that. I think the easiest solution would be to have a separate script LoadingZone on each loading zone that looks something like this:

void OnTriggerEnter2D(Collider2D collider) {
    var p = transform.parent.GetComponent<NameOfTheMainScript>();
    p.OnEnterLoadingZone(collider, this);

Then in the main script you wouldn’t use OnTriggerEnter2D but instead declare the method OnEnterLoadingZone called by the other script:

public void OnEnterLoadingZone(Collider2D collider, LoadingZone zone) {