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

# scale(by:duration:)

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

```
class func scale(by scale: CGFloat, duration: TimeInterval) -> SKAction
```

## Parameters

`scale`

The amount to add to the node’s x and y scale values.

`duration`

The duration of the animation.

## Return Value

A new action object.

## Discussion

When the action executes, the node’s [`xScale`](/documentation/SpriteKit/SKNode/xScale) and [`yScale`](/documentation/SpriteKit/SKNode/yScale) properties are animated to the new value.

This action is reversible; the reverse is created as if the following code is executed:

```swift
let action = SKAction.scale(by: -scale, duration: sec)
```

---

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)