---
title: "loadAsync(contentsOf:withName:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/entity/loadasync(contentsof:withname:)"
---

# 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

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

## Parameters

- `url`: A file URL representing the file to load. For Reality files, append a URL fragment to specify a scene name — for example, my.reality#MyScene.
- `resourceName`: A unique name the method assigns to the resource it loads, for use in network synchronization.

## Discussion

Discussion RealityKit supports loading entities from USD (.usd, .usda, .usdc, .usdz) and Reality (.reality) files. For Reality files that contain multiple scenes, specify which scene to load by appending a URL fragment with the scene name — for example, my.reality#MyScene. For more information on loading entities, see Loading entities from a file.

## See Also

### Loading an entity hierarchy

- [load(named:in:)](realitykit/entity/load(named:in:).md)
- [load(contentsOf:withName:)](realitykit/entity/load(contentsof:withname:).md)
- [loadAsync(named:in:)](realitykit/entity/loadasync(named:in:).md)
