Get a list of all bones on character.

I’ve found plenty of examples for this but I still can’t get a list of the bones. Here’s what seems to work for others but I haven’t got any good results.

SkinnedMeshRenderer renderers;

void Start ()
{
renderers = GameObject.Find(“PlayerMesh”).GetComponent();
print (renderers.bones.Length);
}

renderers.bones.Length prints out 0.
while renderers.sharedMesh prints out the correct mesh.

Any ideas? Thanks!

So it turns out the code above is correct but the gameObject I was using it on isn’t a direct connection to mesh that is skinned. I was testing this on the Survival Shooter game character. I’m not sure how it’s set up but I can’t see to find his bones. But it works fine on a character I import, which I can see all the bones in his hierarchy.

Does anyone know a way to get all the meshes in a character and their bones? Or just all the bones a character has?

Sorry for the noob questions, if there is an example somewhere, feel free just to point at that for me. :wink: