---
title: "init(animations:automaticallyPlaysDefaultAnimation:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/animationlibrarycomponent/init(animations:automaticallyplaysdefaultanimation:)"
---

# init(animations:automaticallyPlaysDefaultAnimation:)

Creates an animation library from a dictionary that associates an animation’s data with its name.

## Declaration

```swift
init(animations: [String : AnimationResource], automaticallyPlaysDefaultAnimation: Bool)
```

## Parameters

- `animations`: A dictionary of animation resources that you key by name.
- `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 doc://com.apple.RealityKit/documentation/RealityKit/AnimationLibraryComponent/automaticallyPlaysDefaultAnimation for details.

## See Also

### Configuring default playback

- [automaticallyPlaysDefaultAnimation](realitykit/animationlibrarycomponent/automaticallyplaysdefaultanimation.md)
- [init(automaticallyPlaysDefaultAnimation:)](realitykit/animationlibrarycomponent/init(automaticallyplaysdefaultanimation:).md)
- [init(dictionaryLiteral:automaticallyPlaysDefaultAnimation:)](realitykit/animationlibrarycomponent/init(dictionaryliteral:automaticallyplaysdefaultanimation:).md)
