I want to setup several rigidbodies so that they unable to push each other around, but not sure how to do it, or even if it’s possible. Basically whenever two of the rigidbodies collide, they should consider each other to be as unyelding as static colliders.
A perfect head-on collision would stop them both, and in the usual scenario of an angled impact they should resolve their speed vectors by sliding off each other as when hitting a normal static collider.
Do you mean when they hit each other head on, they would not bounce off each other but stop dead? I’m guessing so as two objects that hit each other are actually pushing each other and to not push other, would mean they would have to go through each other.
Hehe, I’m not sure how I should describe it in physical terms, which I guess is a bad sign for getting it to work with rigidbodies.
To describe it a different way, say I was coding this behaviour for two non-rotating rectangles in 2d-space. They’re moving towards each other one going right, and slightly up.(A) The other going left and slightly down.(B)
When A hits B, I would remove the X component of the speed vector, equal to the overlap it would cause into rectangle B. The same for the X component of the B speedvector. In a continuous collision A would slide up, and B would slide down, their X vectors blocked by the other rectangle and they are not able to push, leaving them only with the leftover Y components.
This head-on example it can be kind of done by using equally heavy rigidbodies being driven by equal forces, but in other examples it would be different.
For example if one of the rectangles were standing still, no driving forces in place, a moving rectangle still wouldn’t be able to push it. Or if two rectangles were traveling in the same direction, but with the front one slower than the back one, causing a collision, the front one wouldn’t not be accelerated along by the back one.
A non-physical collision system is what I’m looking for I guess.