docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetChild

    GetChild(int)

    Returns the child of the GameObject

    Declaration
    public GameObject GetChild(int childIndex)
    Parameters
    Type Name Description
    int childIndex

    The index of the child to return

    Returns
    Type Description
    GameObject

    The child with matching index if found, null otherwise

    Remarks

    This will take a dependency on the child

    GetChild(Component, int)

    Returns the child of the GameObject

    Declaration
    public GameObject GetChild(Component component, int childIndex)
    Parameters
    Type Name Description
    Component component

    The Object to get the child from

    int childIndex

    The index of the child to return

    Returns
    Type Description
    GameObject

    The child with matching index if found, null otherwise

    Remarks

    This will take a dependency on the child

    GetChild(GameObject, int)

    Returns the child of the GameObject

    Declaration
    public GameObject GetChild(GameObject gameObject, int childIndex)
    Parameters
    Type Name Description
    GameObject gameObject

    The GameObject to get the child from

    int childIndex

    The index of the child to return

    Returns
    Type Description
    GameObject

    The child with matching index if found, null otherwise

    Remarks

    This will take a dependency on the child

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)