Wednesday, February 2, 2011

1.Find the Parent Object name using child in unity3d

if you want to get the parent object name means,

Assume,your parent object name as, Man....it have child name as hand...

GameObject ParentName = GameObject.Find("hand").transform.parent.gameObject;
Debug.Log("parent name :  "+ParentName.name);

it'll give your parent Object name as man....it'll really helpful when you find objects name in runtime.

No comments:

Post a Comment