"OnTriggerEnter2D" function is executed even if "Is Trigger" is disabled

1

I have the GameObject "player" with a box colider with the "Is Trigger" option unselected, ie it is not a trigger.

Inthescriptassociatedwiththeplayerthereisthe"OnTriggerEnter2D" function:

//...
void OnTriggerEnter2D (Collider2D o) {
    print(o.tag);
}

When the player collides with any object, it performs this function even though the box collider is not a trigger.

I no longer have any box collider associated with the player and I have no child objects.

I'm using Unity 5.2.2f1.

    
asked by anonymous 15.11.2015 / 16:23

1 answer

2

The script linked to the object with Collider has to be with On Trigger turned on, your player does not need an OnTrigger Collider if the object that has this setting already has

    
16.11.2015 / 13:17