<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/AnimationFillMode",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation17AnimationFillModeV"
  },
  "title" : "AnimationFillMode"
}
-->

# AnimationFillMode

Options that determine which animation frames display outside of the normal
duration.

```
struct AnimationFillMode
```

## Overview

This structure enables you to lock an animation at its starting frame for a
period of time before beginning. You can also lock an animation to its
ending frame for a specified amount of time after it finishes, or both.

An animation applies the fill mode you choose when a range determined by
[`trimStart`](/documentation/RealityKit/AnimationView/trimStart), [`trimEnd`](/documentation/RealityKit/AnimationView/trimEnd), or
[`trimDuration`](/documentation/RealityKit/AnimationView/trimDuration) exceeds the animation’s underlying duration,
which the framework calculates as the frame count (see
[`frames`](/documentation/RealityKit/SampledAnimation/frames-2j4nj)) multiplied by the
[`frameInterval`](/documentation/RealityKit/SampledAnimation/frameInterval), multiplied by
[`speed`](/documentation/RealityKit/AnimationDefinition/speed).

For example, if you set the [`trimStart`](/documentation/RealityKit/AnimationDefinition/trimStart) property for
an animation of a hand waving to `-1.0` and [`fillMode`](/documentation/RealityKit/SampledAnimation/fillMode) to
[`backwards`](/documentation/RealityKit/AnimationFillMode/backwards) or [`both`](/documentation/RealityKit/AnimationFillMode/both), the hand
displays immediately, freezes at the first animation frame for one second,
and then begins to wave.

## Topics

### Choosing a fill mode

[`static let none: AnimationFillMode`](/documentation/RealityKit/AnimationFillMode/none)

An option that indicates an animation doesn’t display frame data outside
of its normal duration.

[`static let forwards: AnimationFillMode`](/documentation/RealityKit/AnimationFillMode/forwards)

An option that freezes the last frame of the animation until it stops.

[`static let backwards: AnimationFillMode`](/documentation/RealityKit/AnimationFillMode/backwards)

An option that shows the first animation frame while playback progresses
to the beginning position.

[`static let both: AnimationFillMode`](/documentation/RealityKit/AnimationFillMode/both)

An option that displays the animation’s initial frame or final frame
when playback occurs outside of the normal duration.

[`init(rawValue: Int8)`](/documentation/RealityKit/AnimationFillMode/init(rawValue:))

Creates a fill mode from its backing data type.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`ExpressibleByArrayLiteral`](/documentation/Swift/ExpressibleByArrayLiteral)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`OptionSet`](/documentation/Swift/OptionSet)

[`SetAlgebra`](/documentation/Swift/SetAlgebra)

---

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)