---
title: "fadeOpacity(by:duration:)"
framework: scenekit
role: symbol
role_heading: Type Method
path: "scenekit/scnaction/fadeopacity(by:duration:)"
---

# fadeOpacity(by:duration:)

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

## Declaration

```swift
class func fadeOpacity(by factor: CGFloat, duration sec: TimeInterval) -> SCNAction
```

## Parameters

- `factor`: The amount to change the node’s opacity by.
- `sec`: The duration, in seconds, of the animation.

## Return Value

Return Value A new action object.

## Discussion

Discussion When the action executes, the node’s opacity property animates to its new value. This action is reversible; the reverse is created as if the following code had been executed: [SCNAction fadeOpacityBy: -factor duration: sec];

## See Also

### Creating Actions That Change a Node’s Opacity

- [fadeIn(duration:)](scenekit/scnaction/fadein(duration:).md)
- [fadeOut(duration:)](scenekit/scnaction/fadeout(duration:).md)
- [fadeOpacity(to:duration:)](scenekit/scnaction/fadeopacity(to:duration:).md)
