Is there a way to force the end of a collision?
This is a problem I had a looong time ago, but my work-around is no longer practical.
I have a collider that acts as a shield around the player object. It’s on a timer. If the shield timer ends and the shields turn off (using object.active = false) whilst in contact with a collider, the collider class never registers an OnCollisionExit even if the player subsequently leaves the collision, so the player never registers any new collisions to that collider after that point. This is a big problem when the collision is with the world terrain. It, in practical terms, makes the player invulnerable to collisions.
My work around was to have a mesh collider that was flipped from concave to convex and back and the renderer turned on and off as needed, so I had the behaviour I wanted, but it sucks up too many resources.
I need to find another way to do this.
Can you force clear the array that the collision class is using, or find some other way to force CollisionExit?