Get named bone transform

Greetings! I have an object with a bone named... "bonex". I would like to spawn an object on BoneX and parent it to the transform. I know how to do all the steps except how to get the actual named bone from the GameObject. I tried using Transform.Find but that returns an empty transform.

Thanks!

Transform.Find returns an 'empty' transform? Or a null transform? Transform.Find is definitely your best method but it sounds like you've got something setup incorrectly. Can you post more details on how you're using it?

–

Are your bones first childs of your transform, or are they located underneath some other object in the hierarchy?

–

1 Answer

1

It indeed looks like you're doing something wrong. Assuming X is a number "Transform.Find("bone" + x)" should work fine.

Do make sure your string in the find function exactly matches the name of your object. A single wrong capital letter and the function will not find your object. As you spelled "bonex" as well as "BoneX" in your question I suggest you check your capital letters.

Does Transform.Find search recursively? I am under the impression it only search its immediate children. The case may then be his bones are nested deeper in hierarchy.

–