GameObject.GetComponentInChildren

function GetComponentInChildren (type : Type) : Component

Description

Returns the component of Type type in the GameObject or any of its children using depth first search.

Only active components are returned

JavaScript
var script : ScriptName;
script = gameObject.GetComponentInChildren(ScriptName);
script.DoSomething ();

function GetComponentInChildren.<T> () : T

Description

Generic version. See the Generic Functions page for more details.