Contents

init(type:location:)

Creates an accessory anchoring source for a deferred accessory type.

Declaration

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.