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

# init(levels:switchingAt:)

Creates a new Level of Detail component.

```
init(levels: [LevelOfDetailComponent.DetailLevel], switchingAt strategy: LevelOfDetailComponent.SelectionStrategy)
```

## Parameters

`levels`

Array of detail levels, where each level contains entities to show at that level.

`strategy`

The selection strategy with threshold values.

---

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)