Skip to content

GameObject

Danger

Component APIs are an advanced feature. An understanding of how Unity works is required to utilize them.

Member Variables

Name Type Description
name The name of the GameObject.

Functions

Name Return Description
getChild(
getChild(...)
name)
GameObject Returns a child GameObject matching the specified name.
getChildren()
getChildren()
Returns the list of children GameObjects.
getComponent(
getComponent(...)
name)
Component Returns a Component matching the specified name from the GameObject's list of Components.
getComponentInChildren(
getComponentInChildren(...)
name)
Component Returns a Component matching the specified name. Found by searching the Components of the GameObject and its children recursively (depth first).
getComponents(
getComponents(...)
name)
Returns the GameObject's list of Components. name is optional, when specified only Components with specified name will be included.
getComponentsInChildren(
getComponentsInChildren(...)
name)
Returns a list of Components found by searching the GameObject and its children recursively (depth first). name is optional, when specified only Components with specified name will be included.
getMaterials()
getMaterials()
Returns the GameObject's list of Materials.
getMaterialsInChildren()
getMaterialsInChildren()
Returns a list of Materials found by searching the GameObject and its children recursively (depth first).