Contents

loadAsync(contentsOf:withName:)

Returns a load request that creates an entity by asynchronously loading it from a file URL and preserving the entity’s hierarchy.

Declaration

@MainActor @preconcurrency static func loadAsync(contentsOf url: URL, withName resourceName: String? = nil) -> LoadRequest<Entity>

Parameters

  • url:

    The location of a file that represents an entity.

  • resourceName:

    A unique name the method assigns to the resource it loads, for use in network synchronization.

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