Function getEntitiesWithParent

  • Get all entities that have the given entity as their parent

    Returns

    An array of entities that have the given parent

    Example:

    const children = getEntitiesWithParent(engine, myEntity)
    for (const child of children) {
    // process each child entity
    }

    Parameters

    • engine: Pick<IEngine, "defineComponentFromSchema" | "getEntitiesWith">

      the engine running the entities

    • parent: Entity

      the parent entity to find children for

    Returns Entity[]