<!--
{
  "documentType" : "article",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/animating-scenekit-content",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Animating SceneKit Content"
}
-->

# Animating SceneKit Content

Learn about implicit animations, explicit animations, and actions, and when to choose each in your app.

## Discussion

SceneKit animation support is based on the Core Animation framework. (For more about Core Animation, read [Core Animation Programming Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreAnimation_guide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004514).) Several SceneKit classes define *animatable* properties, meaning that in addition to simply assigning a new value to the property, you can create animations that transition smoothly between two values of the property. For example, animating a node’s [`opacity`](/documentation/SceneKit/SCNNode/opacity) property fades the node’s visible content in or out. You can animate content *implicitly* or *explicitly*.

### Animate Content Changes Implicitly

You create an animation implicitly by changing the value of an animatable property. Implicit animation is useful when you want to quickly animate a one-time change or animate several property changes together without writing a lot of animation code.

The [`SCNTransaction`](/documentation/SceneKit/SCNTransaction) class defines SceneKit’s architecture for scene content changes, including implicit animations: A transaction is a single atomic operation that combines multiple changes to nodes, geometries, materials, or other scene content. By default, SceneKit automatically creates a default transaction for all changes you make to a scene during one pass through the run loop.

The default transaction’s duration is zero, so the changes you make to animatable properties occur immediately. However, if you increase the transaction’s [`animationDuration`](/documentation/SceneKit/SCNTransaction/animationDuration), all changes to animatable properties automatically animate. For example, changing the animation duration in an `IBAction` method causes both the position and opacity changes in that method to animate together.

Listing 1. Implicit animation that makes a block of text fall out of the scene while fading away

```objc
- (IBAction)fallAndFade:(id)sender {
    [SCNTransaction setAnimationDuration:1.0];
    _textNode.position = SCNVector3Make(0.0, -10.0, 0.0);
    _textNode.opacity = 0.0;
}
```

### Explicitly Create an Animation

For more complex animations, you can explicitly create an animation object and attach it to the scene element being animated. Creating an animation object also makes an animation reusable, so you can play the same animation at any time on demand or apply it to different elements of your scene.

Choose a <doc://com.apple.documentation/documentation/QuartzCore/CAAnimation> subclass for the type of animation you want to create, specify the property to be animated using key-value coding, and set animation parameters. You then set the animation in motion by attaching it to one or more elements of your scene, as shown in [Animating SceneKit Content](/documentation/SceneKit/animating-scenekit-content).

By using different Core Animation classes, you can combine or sequence several animations or create animations that interpolate a property’s value between several keyframe values. For more about creating animation objects, see [Core Animation Programming Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreAnimation_guide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004514). For more about attaching animations to SceneKit objects, see [`SCNAnimatable`](/documentation/SceneKit/SCNAnimatable).

Listing 2. Explicit animation to vary the 3D extrusion depth of a block of text

```objc
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"geometry.extrusionDepth"];
animation.fromValue = @0.0;
animation.toValue = @100.0;
animation.duration = 1.0;
animation.autoreverses = YES;
animation.repeatCount = INFINITY;
[_textNode addAnimation:animation forKey:@"extrude"];
```

SceneKit also uses <doc://com.apple.documentation/documentation/QuartzCore/CAAnimation> objects for animations created using external 3D authoring tools and saved in scene files. For example, an artist might create a game character with animations for walking, jumping, and other actions. You incorporate these animations into your game by loading animation objects from the scene file using the [`SCNSceneSource`](/documentation/SceneKit/SCNSceneSource) class and attaching them to the [`SCNNode`](/documentation/SceneKit/SCNNode) object that represents the game character.

---

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)