I'm Using Unity 2018.3.11f1 and I'm going crazy trying to understand why the "use triggers" variable of the ContactFilter2D is not having any effect and I'm always detecting only the non-trigger colliders.

The problem is just as simple as that: If I use the OverlapCollider trying to detect a collider that is not a trigger it works perfect. However, if that collider is set as trigger the "OverlapCollider" does not detect it even if I set the variable "useTriggers" of the used filter is set to true (and obviously in false the same behavious appears)

Does anyone have any clue about why it happens?

This is the code:

    ContactFilter2D filter = new ContactFilter2D();
    filter.useTriggers = true;
    Collider2D[] results = new Collider2D[10];
    int collidersDetected = col.OverlapCollider(filter, results);

Thank you for your help in advance.


1 Answer 1


I found out that I had disabled "Queries hit triggers" on the Physics 2D configuration section.

Enabling it solved my problem.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .