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

# fadeOpacity(to:duration:)

Creates an action that adjusts the opacity of a node to a new value.

## Declaration

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

## Parameters

- `opacity`: The new opacity value of the node.
- `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 not reversible; the reverse of this action has the same duration but does not change anything.

## 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(by:duration:)](scenekit/scnaction/fadeopacity(by:duration:).md)
