docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method CreateEntityQuery

    CreateEntityQuery(params ComponentType[])

    Creates a EntityQuery from an array of component types.

    Declaration
    [ExcludeFromBurstCompatTesting("Takes managed array")]
    public EntityQuery CreateEntityQuery(params ComponentType[] requiredComponents)
    Parameters
    Type Name Description
    ComponentType[] requiredComponents

    An array containing the component types.

    Returns
    Type Description
    EntityQuery

    The EntityQuery derived from the specified array of component types.

    See Also
    EntityQueryDesc

    CreateEntityQuery(params EntityQueryDesc[])

    Creates a EntityQuery from an EntityQueryDesc.

    Declaration
    [ExcludeFromBurstCompatTesting("Takes managed array")]
    public EntityQuery CreateEntityQuery(params EntityQueryDesc[] queriesDesc)
    Parameters
    Type Name Description
    EntityQueryDesc[] queriesDesc

    An array of query descsriptions identifying a sets of component types to match.

    Returns
    Type Description
    EntityQuery

    The EntityQuery corresponding to the queryDesc.

    Remarks

    Warning: The ability to construct an EntityQuery from multiple query descriptions is not a supported workflow. Queries with multiple query descriptions are not guaranteed to function correctly in all contexts. In general, try to create queries with a single description. For more information, refer to Creating entity queries.

    CreateEntityQuery(in EntityQueryBuilder)

    Creates an EntityQuery from an EntityQueryBuilder.

    Declaration
    public EntityQuery CreateEntityQuery(in EntityQueryBuilder queriesDesc)
    Parameters
    Type Name Description
    EntityQueryBuilder queriesDesc

    A queryDesc identifying a set of component types.

    Returns
    Type Description
    EntityQuery

    The EntityQuery corresponding to the queryDesc.

    In This Article
    • CreateEntityQuery(params ComponentType[])
    • CreateEntityQuery(params EntityQueryDesc[])
    • CreateEntityQuery(in EntityQueryBuilder)
    Back to top
    Copyright © 2025 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)