I have this character. he is a basic lego person. i want to have me shoot him and he fall to pieces. but he has multiple pieces as his children how do i add a rigid body and break away the children from the object so he will fall apart not just fall down as one thing.
Cycle through each of the child objects and add a rigidbody to them and then use the transform detach children command on the root object to make them into separate objects. http://unity3d.com/support/documentation/ScriptReference/GameObject.AddComponent.html http://unity3d.com/support/documentation/ScriptReference/Transform.DetachChildren.html Code (csharp): for (var child : Transform in transform) { child.gameObject.AddComponent(Rigidbody); } transform.DetachChildren();