<!--
{
  "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/changeObstruction(by:duration:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKAction(cm)changeObstructionBy:duration:"
  },
  "title" : "changeObstruction(by:duration:)"
}
-->

# changeObstruction(by:duration:)

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

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

## Parameters

`v`

The amount to change the obstruction by, in decibels.

`duration`

The duration of the animation, in seconds.

## Return Value

A new action object.

## Discussion

When the action executes, the audio node’s obstruction animates from its current value to its new value. For more information, see <doc://com.apple.documentation/documentation/AVFAudio/AVAudio3DMixing>.

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

```swift
let action = SKAction.changeObstruction(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)