Contents

loadAsync(named:in:)

Returns a load request that creates an entity by asynchronously loading it from a bundle.

Declaration

@MainActor @preconcurrency static func loadAsync(named name: String, in bundle: Bundle? = nil) -> LoadRequest<Entity>

Parameters

  • name:

    The base name of the file to load, omitting the filename extension.

  • bundle:

    The bundle containing the file. Use nil to search the app’s main bundle.

Mentioned in

Return Value

A resource loader that publishes the root entity in the loaded file.

Discussion

RealityKit supports loading entities from USD (.usd, .usda, .usdc, .usdz) and Reality (.reality) files.

When building your app, Xcode automatically converts any Reality Composer projects (.rcproject) in the selected target into Reality files, which it then copies into your app’s bundle.

For more information on loading entities, see Loading entities from a file.

See Also

Loading an entity hierarchy