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

# init(from:named:)

Creates an entity by asynchronously loading it from the in-memory contents of a file stored in a Data object.

```
@MainActor @preconcurrency convenience init(from data: Data, named name: String? = nil) async throws
```

## Parameters

`data`

The Data object containing the in-memory contents of the file to load.

## Return Value

The root entity of the loaded file.

## Discussion

RealityKit supports loading entities from USD (`.usd`, `.usda`, `.usdc`,
`.usdz`) and Reality (`.reality`) files.
This method automatically determines the file type using the first few bytes of the Data object.

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

See [`init(named:in:)`](/documentation/RealityKit/Entity/init(named:in:)) for an example of optimally loading content.

---

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)