---
title: automaticallyPlaysDefaultAnimation
framework: realitykit
role: symbol
role_heading: Instance Property
path: realitykit/animationlibrarycomponent/automaticallyplaysdefaultanimation
---

# automaticallyPlaysDefaultAnimation

Whether to automatically play the default animation when the entity is added to a scene and enabled. Default value is false, meaning the default animation will not be automatically played by default. This value can only be set when initializing AnimationLibraryComponent

## Declaration

```swift
var automaticallyPlaysDefaultAnimation: Bool { get }
```

## Return Value

Return Value

true if automatically play default animation is enabled false if automatically play default animation is disabled

## Discussion

Discussion When set to true, the animation system automatically plays the default animation when the entity is added to a scene and enabled. The default animation is determined by defaultKey or, if that’s not set, the first animation in the library. When set to false, animations require manual playback using playAnimation(_:transitionDuration:startsPaused:). Example var library = AnimationLibraryComponent(automaticallyPlaysDefaultAnimation: true) library["idle"] = idleAnimation library.defaultKey = "idle" entity.components.set(library) // Animation plays automatically when the entity is added to a scene and enabled

## See Also

### Configuring default playback

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