"Queries Start in Colliders" not working with Polygon Collider 2D

I have a game object with a PolygonCollider2D attached. In Edit > Project Settings > Physics2D I have unchecked “Queries Start In Colliders”. I have the following line of code that executes on the gameObject during Update:

	RaycastHit2D raycast = Physics2D.Raycast (transform.position, directionToPlayer);

With the PolygonCollider2D active, it always returns the gameObject. If I switch from a PolygonCollider2D to a Circle or BoxCollider2D, then it works as expected(returning the first object it collides with, ignoring the gameObject casting it). Any suggestions would be great!


Try to adjust your polygon collider so it becomes convex. If you have a complex concave sprite, use compound convex colliders.