|
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!
(comments are locked)
|
|
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.
Dec 16 '10 at 12:12 AM
Statement ♦♦
(comments are locked)
|

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?