<!--
{
  "documentType" : "article",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/action-initializers",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Action Initializers"
}
-->

# Action Initializers

Use these functions to create actions.

## Discussion

Most actions implement specific predefined animations that are done for you by SpriteKit. If your animation needs fall outside of the suite provided here, then you should:

- Consider using the methods in Creating Custom Actions below (never subclass `SKAction`)
- Consider the advice in [Drive Game Logic](/documentation/SpriteKit/getting-started-with-actions#Drive-Game-Logic)

### Choose an Initializer for the Property You Want to Alter

Most actions allow you to change a node’s properties and some actions specifically apply to specific nodes, like [`SKSpriteNode`](/documentation/SpriteKit/SKSpriteNode)’s actions for animating its color or texture.

Here are the most common animated properties:

- Changing a node’s [`position`](/documentation/SpriteKit/SKNode/position) and [`zRotation`](/documentation/SpriteKit/SKNode/zRotation)
- Changing a node’s `size` or scaling properties
- Changing a node’s visibility or making it translucent
- Changing a sprite node’s contents so that it animates through a series of textures
- Colorizing a sprite node
- Playing sounds
- Removing a node from the node tree
- Calling a block
- Invoking a selector on an object

See [Action Initializers](/documentation/SpriteKit/action-initializers) for a full list of action types.

### Chaining Actions

Actions can be chained together in multiple ways:

- A *sequence action* has multiple child actions. Each action in the sequence begins after the previous action ends.
- A *group action* has multiple child actions. All actions stored in the group begin executing at the same time.
- A *repeating action* stores a single child action. When the child action completes, it is restarted.

To delay a subsequent action in the chain, insert a [`wait(forDuration:)`](/documentation/SpriteKit/SKAction/wait(forDuration:)) action in the sequence, and remember that groups, sequences, and repeating actions may be nested.

## Topics

### Animating a Node’s Position in a Linear Path

Animate linear node movement.

[`+  moveByX:y:duration:`](/documentation/SpriteKit/SKAction/moveBy(x:y:duration:))

Creates an action that moves a node relative to its current position.

[`+  moveBy:duration:`](/documentation/SpriteKit/SKAction/move(by:duration:))

Creates an action that moves a node relative to its current position.

[`+  moveTo:duration:`](/documentation/SpriteKit/SKAction/move(to:duration:))

Creates an action that moves a node to a new position.

[`+  moveToX:duration:`](/documentation/SpriteKit/SKAction/moveTo(x:duration:))

Creates an action that moves a node horizontally.

[`+  moveToY:duration:`](/documentation/SpriteKit/SKAction/moveTo(y:duration:))

Creates an action that moves a node vertically.

### Animating a Node’s Position Along a Custom Path

Provide a path for the node to follow.

[`+  followPath:duration:`](/documentation/SpriteKit/SKAction/follow(_:duration:))

Creates an action that moves the node along a relative path, orienting the node to the path.

[`+  followPath:speed:`](/documentation/SpriteKit/SKAction/follow(_:speed:))

Creates an action that moves the node along a relative path at a specified speed, orienting the node to the path.

[`+  followPath:asOffset:orientToPath:duration:`](/documentation/SpriteKit/SKAction/follow(_:asOffset:orientToPath:duration:))

Creates an action that moves the node along a path.

[`+  followPath:asOffset:orientToPath:speed:`](/documentation/SpriteKit/SKAction/follow(_:asOffset:orientToPath:speed:))

Creates an action that moves the node at a specified speed along a path.

### Animating the Rotation of a Node

Animate the z rotation of a node. If instead you wish to change the x or y rotation of a node, see [`SKTransformNode`](/documentation/SpriteKit/SKTransformNode)

A node that allows its children to rotate in 3D..

[`+  rotateByAngle:duration:`](/documentation/SpriteKit/SKAction/rotate(byAngle:duration:))

Creates an action that rotates the node by a relative value.

[`+  rotateToAngle:duration:`](/documentation/SpriteKit/SKAction/rotate(toAngle:duration:))

Creates an action that rotates the node counterclockwise to an absolute angle.

[`+  rotateToAngle:duration:shortestUnitArc:`](/documentation/SpriteKit/SKAction/rotate(toAngle:duration:shortestUnitArc:))

Creates an action that rotates the node to an absolute value.

### Controlling the Action’s Speed

Control the speed of an animation.

[`+  speedBy:duration:`](/documentation/SpriteKit/SKAction/speed(by:duration:))

Creates an action that changes how fast the node executes actions by a relative value.

[`+  speedTo:duration:`](/documentation/SpriteKit/SKAction/speed(to:duration:))

Creates an action that changes how fast the node executes actions.

### Animating the Scaling of a Node

Animate the visual scaling of a node.

[`+  scaleBy:duration:`](/documentation/SpriteKit/SKAction/scale(by:duration:))

Creates an action that changes the x and y scale values of a node by a relative value.

[`+  scaleToSize:duration:`](/documentation/SpriteKit/SKAction/scale(to:duration:)-43bz6)

Creates an action that changes the x and y scale values of a node to achieve

[`+  scaleTo:duration:`](/documentation/SpriteKit/SKAction/scale(to:duration:)-1xyzs)

Creates an action that changes the x and y scale values of a node.

[`+  scaleXBy:y:duration:`](/documentation/SpriteKit/SKAction/scaleX(by:y:duration:))

Creates an action that adds relative values to the x and y scale values of a node.

[`+  scaleXTo:y:duration:`](/documentation/SpriteKit/SKAction/scaleX(to:y:duration:))

Creates an action that changes the x and y scale values of a node.

[`+  scaleXTo:duration:`](/documentation/SpriteKit/SKAction/scaleX(to:duration:))

Creates an action that changes the x scale value of a node to a new value.

[`+  scaleYTo:duration:`](/documentation/SpriteKit/SKAction/scaleY(to:duration:))

Creates an action that changes the y scale value of a node to a new value.

### Animating the Transparency of a Node

Gradually change a node’s transparency.

[`+  fadeInWithDuration:`](/documentation/SpriteKit/SKAction/fadeIn(withDuration:))

Creates an action that changes the alpha value of the node to `1.0`.

[`+  fadeOutWithDuration:`](/documentation/SpriteKit/SKAction/fadeOut(withDuration:))

Creates an action that changes the alpha value of the node to `0.0`.

[`+  fadeAlphaBy:duration:`](/documentation/SpriteKit/SKAction/fadeAlpha(by:duration:))

Creates an action that adjusts the alpha value of a node by a relative value.

[`+  fadeAlphaTo:duration:`](/documentation/SpriteKit/SKAction/fadeAlpha(to:duration:))

Creates an action that adjusts the alpha value of a node to a new value.

### Animating a Node’s Texture

Change a node’s texture or the texture’s properties.

[`+  resizeByWidth:height:duration:`](/documentation/SpriteKit/SKAction/resize(byWidth:height:duration:))

Creates an action that adjusts the size of a sprite.

[`+  resizeToHeight:duration:`](/documentation/SpriteKit/SKAction/resize(toHeight:duration:))

Creates an action that changes the height of a sprite to a new absolute value.

[`+  resizeToWidth:duration:`](/documentation/SpriteKit/SKAction/resize(toWidth:duration:))

Creates an action that changes the width of a sprite to a new absolute value.

[`+  resizeToWidth:height:duration:`](/documentation/SpriteKit/SKAction/resize(toWidth:height:duration:))

Creates an action that changes the width and height of a sprite to a new absolute value.

[`+  setTexture:`](/documentation/SpriteKit/SKAction/setTexture(_:))

Creates an action that changes a sprite’s texture.

[`+  setTexture:resize:`](/documentation/SpriteKit/SKAction/setTexture(_:resize:))

Creates an action that changes a sprite’s texture, possibly resizing the sprite.

[`+  animateWithTextures:timePerFrame:`](/documentation/SpriteKit/SKAction/animate(with:timePerFrame:))

Creates an action that animates changes to a sprite’s texture.

[`+  animateWithTextures:timePerFrame:resize:restore:`](/documentation/SpriteKit/SKAction/animate(with:timePerFrame:resize:restore:))

Creates an action that animates changes to a sprite’s texture, possibly resizing the sprite.

[`+  setNormalTexture:`](/documentation/SpriteKit/SKAction/setNormalTexture(_:))

Creates an action that changes a sprite’s normal texture.

[`+  setNormalTexture:resize:`](/documentation/SpriteKit/SKAction/setNormalTexture(_:resize:))

Creates an action that changes a sprite’s normal texture, possibly resizing the sprite.

[`+  animateWithNormalTextures:timePerFrame:`](/documentation/SpriteKit/SKAction/animate(withNormalTextures:timePerFrame:))

Creates an action that animates changes to a sprite’s normal texture.

[`+  animateWithNormalTextures:timePerFrame:resize:restore:`](/documentation/SpriteKit/SKAction/animate(withNormalTextures:timePerFrame:resize:restore:))

Creates an action that animates changes to a sprite’s texture.

[`+  colorizeWithColor:colorBlendFactor:duration:`](/documentation/SpriteKit/SKAction/colorize(with:colorBlendFactor:duration:))

Creates an animation that animates a sprite’s color and blend factor.

[`+  colorizeWithColorBlendFactor:duration:`](/documentation/SpriteKit/SKAction/colorize(withColorBlendFactor:duration:))

Creates an action that animates a sprite’s blend factor.

### Animating Properties of a Node’s Physics Body

Physics actions are instantaneous and therefore more useful when `Chaining Actions` or [Reuse Actions](/documentation/SpriteKit/getting-started-with-actions#Reuse-Actions).

[`+  applyForce:duration:`](/documentation/SpriteKit/SKAction/applyForce(_:duration:))

Creates an action that applies a force to the center of gravity of a node’s physics body.

[`+  applyTorque:duration:`](/documentation/SpriteKit/SKAction/applyTorque(_:duration:))

Creates an action that applies a torque to a node’s physics body.

[`+  applyForce:atPoint:duration:`](/documentation/SpriteKit/SKAction/applyForce(_:at:duration:))

Creates an action that applies a force to a specific point on a node’s physics body.

[`+  applyImpulse:duration:`](/documentation/SpriteKit/SKAction/applyImpulse(_:duration:))

Creates an action that applies an impulse to the center of gravity of a physics body.

[`+  applyAngularImpulse:duration:`](/documentation/SpriteKit/SKAction/applyAngularImpulse(_:duration:))

Creates an action that applies an angular impulse to a node’s physics body.

[`+  applyImpulse:atPoint:duration:`](/documentation/SpriteKit/SKAction/applyImpulse(_:at:duration:))

Creates an action that applies an impulse to a specific point of a node’s physics body.

[`+  applyImpulse:duration:`](/documentation/SpriteKit/SKAction/applyImpulse(_:duration:))

Creates an action that applies an impulse to the center of gravity of a physics body.

[`+  changeChargeTo:duration:`](/documentation/SpriteKit/SKAction/changeCharge(to:duration:))

Creates an action that changes the charge of a node’s physics body to a new value.

[`+  changeChargeBy:duration:`](/documentation/SpriteKit/SKAction/changeCharge(by:duration:))

Creates an action that changes the charge of a node’s physics body by a relative value.

[`+  changeMassTo:duration:`](/documentation/SpriteKit/SKAction/changeMass(to:duration:))

Creates an action that changes the mass of a node’s physics body to a new value.

[`+  changeMassBy:duration:`](/documentation/SpriteKit/SKAction/changeMass(by:duration:))

Creates an action that changes the mass of a node’s physics body by a relative value.

[`+  strengthTo:duration:`](/documentation/SpriteKit/SKAction/strength(to:duration:))

Creates an action that animates a change of a physics field’s strength.

[`+  strengthBy:duration:`](/documentation/SpriteKit/SKAction/strength(by:duration:))

Creates an action that animates a change of a physics field’s strength to a value relative to the existing value.

[`+  falloffTo:duration:`](/documentation/SpriteKit/SKAction/falloff(to:duration:))

Creates an action that animates a change of a physics field’s falloff.

[`+  falloffBy:duration:`](/documentation/SpriteKit/SKAction/falloff(by:duration:))

Creates an action that animates a change of a physics field’s falloff to a value relative to the existing value.

### Reversing an Animation

Create a new action that is the opposite of another action.

[`-  reversedAction`](/documentation/SpriteKit/SKAction/reversed())

Creates an action that reverses the behavior of another action.

### Animate the Warping of a Node

Interpolate the warping of a node over time.

[`+  animateWithWarps:times:`](/documentation/SpriteKit/SKAction/animate(withWarps:times:))

Creates an action to distort a node through a sequence of [`SKWarpGeometry`](/documentation/SpriteKit/SKWarpGeometry) objects.

[`+  animateWithWarps:times:restore:`](/documentation/SpriteKit/SKAction/animate(withWarps:times:restore:))

Creates an action to distort a node through a sequence of [`SKWarpGeometry`](/documentation/SpriteKit/SKWarpGeometry) objects.

[`+  warpTo:duration:`](/documentation/SpriteKit/SKAction/warp(to:duration:))

Creates an action to distort a node based using an [`SKWarpGeometry`](/documentation/SpriteKit/SKWarpGeometry) object.

### Controlling the Audio of a Node

Audio actions are instantaneous and so, more useful when `Chaining Actions` or [Reuse Actions](/documentation/SpriteKit/getting-started-with-actions#Reuse-Actions).

[`+  playSoundFileNamed:waitForCompletion:`](/documentation/SpriteKit/SKAction/playSoundFileNamed(_:waitForCompletion:))

Creates an action that plays a sound.

[`+  play`](/documentation/SpriteKit/SKAction/play())

Creates an action that tells an audio node to start playback.

[`+  pause`](/documentation/SpriteKit/SKAction/pause())

Creates an action that tells an audio node to pause playback.

[`+  stop`](/documentation/SpriteKit/SKAction/stop())

Creates an action that tells an audio node to stop playback.

[`+  changePlaybackRateTo:duration:`](/documentation/SpriteKit/SKAction/changePlaybackRate(to:duration:))

Creates an action that changes an audio node’s playback rate to a new value.

[`+  changePlaybackRateBy:duration:`](/documentation/SpriteKit/SKAction/changePlaybackRate(by:duration:))

Creates an action that changes an audio node’s playback rate by a relative amount.

[`+  changeVolumeTo:duration:`](/documentation/SpriteKit/SKAction/changeVolume(to:duration:))

Creates an action that changes an audio node’s volume to a new value.

[`+  changeVolumeBy:duration:`](/documentation/SpriteKit/SKAction/changeVolume(by:duration:))

Creates an action that changes an audio node’s volume by a relative value.

[`+  changeObstructionTo:duration:`](/documentation/SpriteKit/SKAction/changeObstruction(to:duration:))

Creates an action that changes an audio node’s obstruction to a new value.

[`+  changeObstructionBy:duration:`](/documentation/SpriteKit/SKAction/changeObstruction(by:duration:))

Creates an action that changes an audio node’s obstruction by a relative value.

[`+  changeOcclusionTo:duration:`](/documentation/SpriteKit/SKAction/changeOcclusion(to:duration:))

Creates an action that changes an audio node’s occlusion to a new value.

[`+  changeOcclusionBy:duration:`](/documentation/SpriteKit/SKAction/changeOcclusion(by:duration:))

Creates an action that changes an audio node’s occlusion by a relative value.

[`+  changeReverbTo:duration:`](/documentation/SpriteKit/SKAction/changeReverb(to:duration:))

Creates an action that changes an audio node’s reverb to a new value.

[`+  changeReverbBy:duration:`](/documentation/SpriteKit/SKAction/changeReverb(by:duration:))

Creates an action that changes an audio node’s reverb by a relative value.

[`+  stereoPanTo:duration:`](/documentation/SpriteKit/SKAction/stereoPan(to:duration:))

Creates an action that changes an audio node’s stereo panning to a new value.

[`+  stereoPanBy:duration:`](/documentation/SpriteKit/SKAction/stereoPan(by:duration:))

Creates an action that changes an audio node’s stereo panning by a relative value.

### Removing a Node from the Scene

Instantaneous action that is useful when `Chaining Actions` or [Reuse Actions](/documentation/SpriteKit/getting-started-with-actions#Reuse-Actions).

[`+  removeFromParent`](/documentation/SpriteKit/SKAction/removeFromParent())

Creates an action that removes the node from its parent.

### Running Actions on Children

Run an action on a child node by its name.

[`+  runAction:onChildWithName:`](/documentation/SpriteKit/SKAction/run(_:onChildWithName:))

Creates an action that runs an action on a named child object.

### Chaining Actions

Create an action that contains a series, or chain, of other actions.

[`+  group:`](/documentation/SpriteKit/SKAction/group(_:))

Creates an action that runs a collection of actions in parallel.

[`+  sequence:`](/documentation/SpriteKit/SKAction/sequence(_:))

Creates an action that runs a collection of actions sequentially.

[`+  repeatAction:count:`](/documentation/SpriteKit/SKAction/repeat(_:count:))

Creates an action that repeats another action a specified number of times.

[`+  repeatActionForever:`](/documentation/SpriteKit/SKAction/repeatForever(_:))

Creates an action that repeats another action forever.

### Delaying Actions

Delay a subseqent action in a sequence of other actions.

[`+  waitForDuration:`](/documentation/SpriteKit/SKAction/wait(forDuration:))

Creates an action that idles for a specified period of time.

[`+  waitForDuration:withRange:`](/documentation/SpriteKit/SKAction/wait(forDuration:withRange:))

Creates an action that idles for a randomized period of time.

### Performing Inverse Kinematics

[Working with Inverse Kinematics](/documentation/SpriteKit/working-with-inverse-kinematics)

Gain fine-tuned control of objects that are connected by joints.

[`+  reachTo:rootNode:duration:`](/documentation/SpriteKit/SKAction/reach(to:rootNode:duration:)-9gdvl)

Creates an action that performs an inverse kinematic reach.

[`+  reachTo:rootNode:velocity:`](/documentation/SpriteKit/SKAction/reach(to:rootNode:velocity:)-8xv45)

Creates an action that performs an inverse kinematic reach.

[`+  reachToNode:rootNode:duration:`](/documentation/SpriteKit/SKAction/reach(to:rootNode:duration:)-1db76)

Creates an action that performs an inverse kinematic reach.

[`+  reachToNode:rootNode:velocity:`](/documentation/SpriteKit/SKAction/reach(to:rootNode:velocity:)-7gbvx)

Creates an action that performs an inverse kinematic reach.

### Creating Custom Actions

Provide code that implements your own action.

[`+  actionNamed:`](/documentation/SpriteKit/SKAction/init(named:))

Creates an action of the given name from an action file.

[`+  actionNamed:duration:`](/documentation/SpriteKit/SKAction/init(named:duration:))

Creates an action of the given name from an action file with a new duration.

[`init(named:fromURL:)`](/documentation/SpriteKit/SKAction/init(named:fromURL:))

Creates an action of the given name from an action file.

[`init(named:fromURL:duration:)`](/documentation/SpriteKit/SKAction/init(named:fromURL:duration:))

Creates an action of the given name from an action file with a new duration.

[`+  customActionWithDuration:actionBlock:`](/documentation/SpriteKit/SKAction/customAction(withDuration:actionBlock:))

Creates an action that executes a block over a duration.

[`+  performSelector:onTarget:`](/documentation/SpriteKit/SKAction/perform(_:onTarget:))

Creates an action that calls a method on an object.

[`+  runBlock:`](/documentation/SpriteKit/SKAction/run(_:))

Creates an action that executes a block.

[`+  runBlock:queue:`](/documentation/SpriteKit/SKAction/run(_:queue:))

Creates an action that executes a block on a specific dispatch queue.

### Controlling Node Visibility

Control a node’s visibility.

[`+  unhide`](/documentation/SpriteKit/SKAction/unhide())

Creates an action that makes a node visible.

[`+  hide`](/documentation/SpriteKit/SKAction/hide())

Creates an action that hides a node.



---

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)