Rigidbodies violently repel when replacing with pre-shattered opject

Intro

Working on a semi-realistic destruction simulation and was doing some initial testing. I 'm attempting to require a certain amount of force before an object breaks. The nature of the simulation would require multiple objects all colliding with each other.

The Problem

A cube is set to instantiate a “cut up” version of itself upon receiving a certain amount of force (mimicking weaknesses in materials. The code to achieve this is given below:

void OnCollisionEnter(Collision collision) {
		if (collision.relativeVelocity.magnitude > MagnitudeThreshold) {
			Object.Destroy (this.gameObject);
			GameObject Fracture = (GameObject)Instantiate (Prefab, transform.position, transform.rotation);
		} else {
		}

On it’s own the cube breaks as expected, but when multiple “breakable” cubes are stacked and the bottom cube is removed a large “explosion” occurs - not very realistic (shown bottom image). When the “broken” prefab versions of the cubes are arranged identically they behave as expected, as shown top image.

101396-huboui3-imgur-2.jpg

When you instantiated your prefab pieces, then their collider overlap which cause the violent explosion. Add a script to prevent the overlap when instantiating.

Another thing you could do is say that it’s a feature and not a bug.

After some fiddling I finally worked it out for myself. In the physics project settings I enable Adaptive Force and ramped up the Default Solver Velocity Iterations. This resulted in a much better collsion detecting and far more realistic results.

I’ll wait to see if someone has a better solution before marking the best answer.