<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/AnchoringComponent/AccessoryAnchoringSource/init(type:location:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation18AnchoringComponentV09AccessoryC6SourceV4type8locationA2E0E4TypeV_SSSgtcfc"
  },
  "title" : "init(type:location:)"
}
-->

# init(type:location:)

Creates an accessory anchoring source for a deferred accessory type.

```
init(type: AnchoringComponent.AccessoryAnchoringSource.AccessoryType, location: String? = nil)
```

## Parameters

`type`

The type of accessory to anchor to (e.g., `.leftController`, `.stylus`)

`location`

Optional location name on the accessory (e.g., “aim”, “grip”, “tip”).
If `nil` or empty, anchors to the accessory’s origin.
If the specified location doesn’t exist at runtime, falls back to origin.

## Discussion

Use this initializer when you want to anchor to an accessory that may not be
connected yet. The system will automatically bind to a matching accessory when
it connects.

---

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)