Set up a Convex Mesh Collider Trigger. Have a script attached with OnTriggerStay.
Move mesh over a capsule collider: OnTriggerStay fires. Fine, that's cool.
Move mesh away from capsule collider... OnTriggerStay carries on firing, until the capsule collider moves a certain amount. Not so cool.
Why? How do I stop this from happening? Attaching a primitive collider trigger and everything works as intended.
It appears that if the capsule collider intersects with the surface of the trigger, then everything works as intended. If it goes completely inside, then the onTriggerStay gets caught firing.
One way to get around this is to keep manually updating the mesh of the trigger every frame. But eff me, that's a bit costly.
In anticipation of possible answers; can't do a raycast because there's going to be multiple objects on that physics layer, potentially overlapping. Can't use compound primitives either, necessary shape of trigger won't allow it.
↧