<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/Entity/load(named:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation6EntityC4load5named2inACSS_So8NSBundleCSgtKFZ"
  },
  "title" : "load(named:in:)"
}
-->

# load(named:in:)

Returns an entity by synchronously loading it from a bundle.

```
@MainActor @preconcurrency static func load(named name: String, in bundle: Bundle? = nil) throws -> Entity
```

## Parameters

`name`

The base name of the file to load.  An extension isn’t required,
but you can provide one to resolve collisions.  In the presence of a collision,
the provided name resolves with the following order of precedence:
[`.usdz`, `.usd`, `.usdc`, `.usda`].

`bundle`

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

## Return Value

The root entity in the loaded file.

## Discussion

Loading an [`Entity`](/documentation/RealityKit/Entity) with this method blocks the main actor because it’s synchronous, so only call it from a command-line application.
The method can stall a regular app, which makes it visibly hitch, and the system terminates an app if its UI becomes unresponsive.
See [`init(named:in:)`](/documentation/RealityKit/Entity/init(named:in:)) for an example that demonstrates how to safely load content.

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](/documentation/RealityKit/loading-entities-from-a-file).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)