docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetParent

    GetParent()

    Returns the parent of the GameObject

    Declaration
    public GameObject GetParent()
    Returns
    Type Description
    GameObject

    The parent if one is found or null otherwise

    Remarks

    This will take a dependency on the parent

    GetParent(Component)

    Returns the parent of the GameObject

    Declaration
    public GameObject GetParent(Component component)
    Parameters
    Type Name Description
    Component component

    The Object to get the parent from

    Returns
    Type Description
    GameObject

    The parent if one is found or null otherwise

    Remarks

    This will take a dependency on the parent

    GetParent(GameObject)

    Returns the parent of the GameObject

    Declaration
    public GameObject GetParent(GameObject gameObject)
    Parameters
    Type Name Description
    GameObject gameObject

    The GameObject to get the parent from

    Returns
    Type Description
    GameObject

    The parent if one is found or null otherwise

    Remarks

    This will take a dependency on the parent

    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)