Force Reset Collision Class?

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?

If you move a collider to somewhere it won’t mess with the rest of your game, and don’t turn it off, the collision will end properly. After that (say a frame later) you can turn it off if it needs to be off.

So - (Unity.js junk code for illustrative purposes only)

function ShieldsOff () {
	shields.transform.position = Vector3 (0, 1000, 0);
	yield;
	shields.SetActiveRecursively(false);	// As there is other junk in the GO
	yield;	// Maybe? Just in case it's not shut off when it comes back to the parent?
	shields.transform.localPosition = Vector3(0, 0, 0);
}

That kindov thing?