---
title: "value(forAttributeNamed:)"
framework: spritekit
role: symbol
role_heading: Instance Method
path: "spritekit/skeffectnode/value(forattributenamed:)"
---

# value(forAttributeNamed:)

Gets the value of a shader attribute.

## Declaration

```swift
func value(forAttributeNamed key: String) -> SKAttributeValue?
```

## Parameters

- `key`: The attribute name.

## Return Value

Return Value An attribute value object containing the scalar or vector value or nil if no such attribute exists.

## See Also

### Applying a Shader with an Effect Node

- [shader](spritekit/skeffectnode/shader.md)
- [attributeValues](spritekit/skeffectnode/attributevalues.md)
- [setValue(_:forAttribute:)](spritekit/skeffectnode/setvalue(_:forattribute:).md)
