How to move a rigidbody through another rigidbody?

I have two non-kinematic rigidbodies that I’m moving using AddForce in FixedUpdate. When one of the rigidbodies reaches the edge of the screen, I wrap it around to the other side by assigning transform.position to the new position. What this means is that the re-positioned wrapped rigidbody can end up “on top” of the other one, i.e. they are intersecting. At this point they are stuck.

My question is how can I get Unity’s physics engine to allow these “stuck” rigidbodies to move through each other, perhaps with more friction than normal, so that they sort of “stuggle” to get free of either other but without being completely stuck? For instance can I chance the physics material to allow this?

I’d do both of the above, but rather than turn off collisions between the objects all the time, I would call Physics.IgnoreCollision when an object ends up on top of another. You can then change the force, fake some struggling, until they’re clear. Then you’re free to re-enable collisions between the two objects again.

Hi!
a couple of suggestions

1 when you reposition the submarine, make sure it is not going to intersect with the other submarine, thru code.
I guess you could offset it in screen.y, or z even.

2 use the collision matrix in settings physics to make the colliders ignore each other.