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

# loadModelAsync(contentsOf:withName:)

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

## Declaration

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

## 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

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

## See Also

### Loading a flattened model entity

- [loadModel(named:in:)](realitykit/entity/loadmodel(named:in:).md)
- [loadModel(contentsOf:withName:)](realitykit/entity/loadmodel(contentsof:withname:).md)
- [loadModelAsync(named:in:)](realitykit/entity/loadmodelasync(named:in:).md)
