x


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!

more ▼

asked Nov 09 '10 at 08:03 PM

Dan 11 gravatar image

Dan 11
3 2 2 5

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?

Nov 10 '10 at 05:18 AM Adam Rademacher

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

Dec 16 '10 at 12:12 AM Statement ♦♦
(comments are locked)
10|3000 characters needed characters left

1 answer: sort oldest

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.

more ▼

answered Nov 10 '10 at 02:24 PM

Yoerick gravatar image

Yoerick
729 2 5 14

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)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1276
x143

asked: Nov 09 '10 at 08:03 PM

Seen: 2294 times

Last Updated: Nov 10 '10 at 02:49 AM