GetComponentInChildren

I’m fighting some easy thing over here, I just don’t know how to get it working.

I have a GameObject which has multiple children.
A few of the children have a components of UILabel type.

If I do something like:

needsHelp.GetComponentInChildren<UILabel>().text

This will refer to the component of the first children it finds.

How can I specify which child I want to refer to?

needsHelp.FindChild(“name”).GetComponent.text;

1 Like

damn … I knew it was that easy :smile: thanks!

1 Like