<!--
{
  "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/AnimationLibraryComponent/init(automaticallyPlaysDefaultAnimation:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation25AnimationLibraryComponentV025automaticallyPlaysDefaultC0ACSb_tcfc"
  },
  "title" : "init(automaticallyPlaysDefaultAnimation:)"
}
-->

# init(automaticallyPlaysDefaultAnimation:)

Creates an empty animation library.

```
init(automaticallyPlaysDefaultAnimation: Bool)
```

## Parameters

`automaticallyPlaysDefaultAnimation`

Whether to automatically play the
default animation when the entity is added to a scene and enabled. When `true`,
the animation system plays the default animation automatically. When `false`,
animations require manual playback. See [`automaticallyPlaysDefaultAnimation`](/documentation/RealityKit/AnimationLibraryComponent/automaticallyPlaysDefaultAnimation)
for details.

## Example

```swift
var library = AnimationLibraryComponent(automaticallyPlaysDefaultAnimation: true)
library.animations["walk"] = walkAnimation
library.defaultKey = "walk"
entity.components.set(library)
```

---

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)