<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNAnimatable/removeAnimation(forKey:fadeOutDuration:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(pl)SCNAnimatable(im)removeAnimationForKey:fadeOutDuration:"
  },
  "title" : "removeAnimation(forKey:fadeOutDuration:)"
}
-->

# removeAnimation(forKey:fadeOutDuration:)

Removes the animation attached to the object with the specified key, smoothly transitioning out of the animation’s effect.

```
func removeAnimation(forKey key: String, fadeOutDuration duration: CGFloat)
```

## Parameters

`key`

A string identifying an attached animation to remove.

`duration`

The duration for transitioning out of the animation’s effect before it is removed.

## Discussion

Use this method to create smooth transitions between the effects of multiple animations. For example, the geometry loaded from a scene file for a game character may have associated animations for player actions such as walking and jumping. When the player lands from a jump, you remove the jump animation so the character continues walking. If you use the [`removeAnimation(forKey:)`](/documentation/SceneKit/SCNAnimatable/removeAnimation(forKey:)) method to remove the jump animation, SceneKit abruptly switches from the current frame of the jump animation to the current frame of the walk animation. If you use the [`removeAnimation(forKey:fadeOutDuration:)`](/documentation/SceneKit/SCNAnimatable/removeAnimation(forKey:fadeOutDuration:)) method instead, SceneKit plays both animations at once during that duration and interpolates vertex positions from one animation to the other, creating a smooth transition.

---

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)