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

# value(forAttributeNamed:)

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

### Customizing Stroking or Fill Drawing

- [Controlling Shape Drawing with Shaders](spritekit/controlling-shape-drawing-with-shaders.md)
- [strokeShader](spritekit/skshapenode/strokeshader.md)
- [fillShader](spritekit/skshapenode/fillshader.md)
- [attributeValues](spritekit/skshapenode/attributevalues.md)
- [setValue(_:forAttribute:)](spritekit/skshapenode/setvalue(_:forattribute:).md)
