<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKAction/speed(to:duration:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKAction(cm)speedTo:duration:"
  },
  "title" : "speed(to:duration:)"
}
-->

# speed(to:duration:)

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

```
class func speed(to speed: CGFloat, duration: TimeInterval) -> SKAction
```

## Parameters

`speed`

The new value for the node’s speed.

`duration`

The duration of the animation.

## Return Value

A new action object.

## Discussion

When the action executes, the node’s [`speed`](/documentation/SpriteKit/SKNode/speed) property animates to the new value.

This action is not reversible; the reverse of this action has the same duration but does not change anything.

---

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)