<!--
{
  "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.

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

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

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

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

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

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

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

Creates an action that moves a node horizontally.

[`moveTo(y: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.

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

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

[`follow(_: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.

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

Creates an action that moves the node along a path.

[`follow(_: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..

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

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

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

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

[`rotate(toAngle: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.

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

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

[`speed(to: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.

[`scale(by: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.

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

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

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

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

[`scaleX(by: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.

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

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

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

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

[`scaleY(to: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.

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

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

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

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

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

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

[`fadeAlpha(to: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.

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

Creates an action that adjusts the size of a sprite.

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

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

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

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

[`resize(toWidth: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.

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

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

[`animate(with: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.

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

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

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

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

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

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

[`colorize(withColorBlendFactor: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(_:at: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(_:at: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.

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

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

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

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

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

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

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

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

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

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

[`strength(by: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.

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

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

[`falloff(by: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.

[`reversed()`](/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.

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

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

[`animate(withWarps: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.

[`warp(to: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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[`stereoPan(by: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.

[`run(_: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.

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

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

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

Creates an action that repeats another action forever.

### Delaying Actions

Delay a subseqent action in a sequence of other actions.

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

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

[`wait(forDuration: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.

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

Creates an action that performs an inverse kinematic reach.

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

Creates an action that performs an inverse kinematic reach.

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

Creates an action that performs an inverse kinematic reach.

[`reach(to: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.

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

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

[`init(named: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.

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

Creates an action that executes a block over a duration.

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

Creates an action that calls a method on an object.

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

Creates an action that executes a block.

[`run(_: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)