- Home /
Determining What an Object is parented to
It should be obvious... but I allowed someone to code some things for me and i'm a bit stuck. The objects in question were parented directly to a bone, however they are no longer parented to this bone it would seem. Well.. they are but it SEEMS asif they are parented to something else now as well so I need to know what that could be.
Long and short of it, is there anyway I could print out what object the bone is parented to or perhaps find that out?
I have enclosed a picture in case it's confusing.
Answer by asafsitner · Oct 03, 2011 at 08:12 AM
They are parented to the bone. Bone_Hand_R to be exact.
Just look at the hierarchy and see what object they're under. If you want to do it in script, just add Debug.Log(transform.parent);
somewhere.
No.. that's not right. If you look closely they are on a slightly different level of parenting. When I delete and re-parent them, they all shift to the LEFT slightly. Which means they are parented to something else.
Strange. Judging from the picture you provided it looks like they're all on the same level as the finger bones. I presume $$anonymous$$imizing Bone_Hand_R make them disappear along with the finger bones.
Do try adding that bit of code to their Awake methods and see what it prints.
Yes I thought they were parented to the hand bone as well. I'll try the debug log.
Idk. It says it's parented to the Bone (the correct one) o_O. The main reason I'm trying to figure out whats going on is because two of my models seem to be acting a bit strange.
Your answer
![](https://koobas.hobune.stream/wayback/20220612233650im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Attach object to bone ingame. 1 Answer
How to bind two gameobjects together? 2 Answers
Attach object to avatar bone 1 Answer
Parent weapon to hand bone 2 Answers
How do I parent an object to a bone? 2 Answers