Skip to content

format

typescript
GameObject.GetComponentsInChildren(type)

class: GameObject

description

Get all instances of a specified type of component in a GameObject and all its child GameObjects.

parameter

param_nametypedescription
typeComponentThe type of component.

reture

typedescription
T|nullReturns an array containing all found instances of the component. If no components of the specified type are found, returns null.

code example