i want to show main parent name like :
Player --> a1 --> a2 --> a3 --> a4 --> a5 ....
i added a script to last parent.
and i want to it print main parent name "Player"
i tried transform.root.parent.name but ain't work.
Mar 07 '11 at 12:23 PM
Jul 31 '11 at 05:13 AM
sometimes i think im a fool : transform.root.name :)
root.parent doesn't make any sense. Transform.root can't have a parent.
Mar 07 '11 at 12:33 PM
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
Once you sign in you will be able to subscribe for any updates here
Answers and Comments
The best place to ask and answer questions about development with Unity. Check out our FAQ for more information.
To help users post good questions and use the site effectively we have posted a tutorial video. Please check it out.
asked: Mar 07 '11 at 12:23 PM
Seen: 1514 times
Last Updated: Mar 07 '11 at 12:23 PM
Select a child's variables from the parent.
Is there any way to use parenting as an organization tool without creating a Transform bond?
Can an instantiated object inherit its parent's velocity?
Should i be able to add gameobjects as children to a parent with a rigidbody?
How to use Parent/Child
Model rotation and hierarchy of game objects - not rotating!
How to make a blob shadow project from a fixed angle as the object rotates?