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 Component.

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.