<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/Entity/init(named:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation6EntityC5named2inACSS_So8NSBundleCSgtYaKcfc"
  },
  "title" : "init(named:in:)"
}
-->

# init(named:in:)

Creates an entity by asynchronously loading it from a bundle.

```
@MainActor @preconcurrency convenience init(named name: String, in bundle: Bundle? = nil) async throws
```

## Parameters

`name`

The base name of the file to load, omitting the filename extension, or scene name if loading from a `.reality` file.

`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

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

For more information on loading entities, see
[Loading entities from a file](/documentation/RealityKit/loading-entities-from-a-file).

You can use a task group to await all loads before adding them to the scene to
display content from multiple scenes without hitches or pop-in.

```swift
struct SomeRealityView: View {
    var body: some View {
        RealityView { content in
            // Add the initial RealityKit content.
            let entities : [Entity] = await withTaskGroup(of: Entity?.self) { taskGroup in
                // Load all the scenes concurrently.
                taskGroup.addTask { return try? await Entity(named: "SceneA", in: realityKitContentBundle) }
                taskGroup.addTask { return try? await Entity(named: "SceneB", in: realityKitContentBundle) }
                taskGroup.addTask { return try? await Entity(named: "SceneC", in: realityKitContentBundle) }

                var entities = [Entity]()
                // Wait for all the scenes to load.
                for await entity in taskGroup {
                    if let entity {
                        entities.append(entity)
                    }
                }
                return entities
            }
            // Add all the content.
            for entity in entities {
                content.add(entity)
            }
        }
    }
}
```

---

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)