I’m new to unity, and am having what I’m sure must be a simple design issue. I would like my character (a rigidbody2D attached to a couple of collider2Ds) to collide with one set of objects, set A, all of the time, and another set of objects, set B, only some of the time. But even when my character is “not colliding” with set B, I need to know if it is in contact with any member of set B.
Is there a good approach to achieving this within unity’s 2D tools?
I’ve tried layer-based collision detection, changing my character back and forth between a layer that collides with both sets and a layer that collides with only set A. But this method won’t tell me when my character is touching (but not “colliding” with in the physics) set B.
I’ve tried changing the colliders on my character to triggers, but then they don’t collide (physically) with set A.
I’ve tried making a child character that only acts as trigger, but for some reason (possibly because it contains a rigidbody2D of its own) it lags behind the parent character. Creating a parent character and using it to control two sibling characters (one set to ‘trigger’, one not) had similar spacial issues.
If code is helpful, I can copy it over, but really I think I’m just looking for an algorithm or collision detection tool for a very specific scenario. Thanks for any help!