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

# changeMass(by:duration:)

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

```
class func changeMass(by v: Float, duration: TimeInterval) -> SKAction
```

## Parameters

`v`

The amount to add to the physics body’s mass.

`duration`

The duration of the animation.

## Return Value

A new action object.

## Discussion

When the action executes, the physics body’s [`mass`](/documentation/SpriteKit/SKPhysicsBody/mass) property animates from its current value to its new value.

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

```swift
let action = SKAction.changeMass(by: -v, 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)