---
title: "action(forKey:)"
framework: scenekit
role: symbol
role_heading: Instance Method
path: "scenekit/scnactionable/action(forkey:)"
---

# action(forKey:)

Returns an action associated with a specific key.

## Declaration

```swift
func action(forKey key: String) -> SCNAction?
```

## Parameters

- `key`: A string that uniquely identifies a action.

## Return Value

Return Value The action object matching the specified key, or nil if the node does not have an action identified by the key.

## Discussion

Discussion Use this method to retrieve actions you scheduled using the runAction(_:forKey:) or runAction(_:forKey:completionHandler:) method.

## See Also

### Inspecting a Node’s Running Actions

- [hasActions](scenekit/scnactionable/hasactions.md)
- [actionKeys](scenekit/scnactionable/actionkeys.md)
