In Unity, I have Trigger Colliders, and catch the OnTriggerStay(Collider other) events.
Once two Colliders are touching, how do I get the Force vector to make them want to separate again?
In the example below, I have a Sphere and a Box Collider touching. The OnTriggerStay is being called for the Sphere.
I cannot use the center positions of the transforms to get a direction, as that would not give me a very good force vector:
And I do not think I can use the Collider.ClosestPointOnBounds to figure out the Box touch position, because the point I look from (center of Sphere), could be inside the Box Collider itself, which I understand will just return me back the center of the Sphere again. I would not be able to resolve any force vector from that.