Iv got a model which is skinned and has bones in it, what i want to do is when the health reaches 0 I want all the bones to add a rigidbody onto them but i don’t know how i would go about doing this in C#?
Did you already get an array of your bones ?
If not, you should start with this. Create an array that you fill with all the bones in the inspector, then loop on it and add the component !
for (int i=0; i<bones.length; i++)
{
bones*.AddComponent("Rigidbody");*
}
Have a look to :
[Find a child with a name, how to?? - Questions & Answers - Unity Discussions][1]
This may help you…
[1]: Find a child with a name, how to?? - Questions & Answers - Unity Discussions