---
title: "replace(applyToAllLayers:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/animationhandofftype/replace(applytoalllayers:)"
---

# replace(applyToAllLayers:)

Keeps playing the current animation during the transition time and uses the value from that animation as the blend value for the transition to the new animation.

## Declaration

```swift
static func replace(applyToAllLayers: Bool = true) -> AnimationHandoffType
```

## Discussion

Discussion If applyToAllLayers is false, the handoff only replaces current animations that have the same layerId as the blendLayerOffset parameter in the playAnimation() call. If applyToAllLayers is true, the handoff replaces all animations regardless of the layer.
