docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method TryGetComponentObject

    TryGetComponentObject<T>(Entity, out T)

    Attempts to get the managed UnityEngine.Component object from an entity.

    Declaration
    [Obsolete("Managed-component access (AddComponentObject/GetComponentObject/SetComponentObject) is deprecated and will be removed. Convert your data to an unmanaged IComponentData and use the unmanaged Add/Get/SetComponentData APIs. To reference UnityEngine.Object instances, use UnityObjectRef<T>. First deprecated in 6.6.")]
    [ExcludeFromBurstCompatTesting("Returns managed object")]
    public bool TryGetComponentObject<T>(Entity entity, out T result)
    Parameters
    Type Name Description
    Entity entity
    T result
    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    T
    In This Article
    Back to top
    Copyright © 2026 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)