Instantiated Object Rigidbody Not Reacting To Gravity

Im very new to unity and c# in general but I am working on a small project that requires a cube in the scene to be switched out with a prefab of a shattered cube that falls apart.

This is a small snippet of the code used (Missing the funcion and classe holding it).

public GameObject destroyedVersion;

Instantiate(destroyedVersion, transform.position, transform.rotation)
Destroy(gameObject);

The prefab that is meant to shatter and fall apart has a rigid body with gravity and a mesh collider with convex ticked. When i place this prefab into the scene manually it falls apart as expected. Unfortunately when the script places it in it replaces the cube with the shattered one but does not fall apart or react to gravity.
I have checked while the game is running that all the fragments of the cube have a rigidbody and collider and are not restricted and dont have kinematic enabled but it still just floats in the air like a static object.

Thanks for the help :slight_smile:

Somehow i fixed it by instead of deleting the cube game object i just made it non active and gravity then worked.

So i dont know why it works but… Cool.

Hi,
It s a bit old but Ive got the same problem and found the fix :
https://answers.unity.com/questions/917964/gravity-not-working-in-a-sidescrolling-2d-game-aft.html?_ga=2.175842278.538594930.1632597009-530073165.1632490187