I know what you’re thinking - the contact filter isn’t set up right. However, I’m getting unusual results in that I can get results from one particular call, using NoFilter()…
int hitCount = Physics2D.CircleCast(pos, radius, facing, contactFilter.NoFilter(), rayHits, 1.2f);
The above works. However, if I populate contactFilter with anything, no colliders are detected. If I use
contactFilter = contactFilter.NoFilter();
and pass contactFilter, nothing is detected. If I set contactFilter to the defaults defined in the manual for ContactFilter2D.NoFilter()
contactFilter = new ContactFilter2D();
contactFilter.layerMask = Physics2D.AllLayers;
contactFilter.useTriggers = true;
contactFilter.minDepth = -Mathf.Infinity;
contactFilter.maxDepth = Mathf.Infinity;
contactFilter.minNormalAngle = -Mathf.Infinity;
contactFilter.maxNormalAngle = Mathf.Infinity;
I’ve tried positive and negative values for ‘min’ parameters.
My colliders are all kinematic triggers.
Why does passing conactFilter.Nofilter() work but no variation of contactFilter work?
Edit: Raycast works with my contact filter, although it won’t detect my TileMap composite collider which is what I am needing the circle cast for.