I’m working on some mechanism where after I throw an object, at a certain impact force break the object. My only problem is after the cracked version of the moving original one, the direction/movement of the original one gets lost, and leaving the instance just stop on instantiation then going to pieces, now that’s just not realistic. As an example watch a hl2 demo of its physics on throwing.
You could give the original object’s velocity to your instantiated objects. Something like this:
void OnImpact()
{
GameObject myCracked = Instantiate(Cracked, transform.position, Quaternion.identity) as GameObject;
myCracked.GetComponent<Rigidbody>().velocity = GetComponent<Rigidbody>().velocity;
}
Found the solution after a some trial and error.
I found out using a GetComponentsInChildren and using you said @ray2yar. Thanks.