---
title: "subscript(_:)"
framework: scenekit
role: symbol
role_heading: Instance Subscript
path: "scenekit/scntechnique/subscript(_:)"
---

# subscript(_:)

Returns the value associated with the specified GLSL uniform variable or attribute name, using subscript syntax.

## Declaration

```swift
subscript(key: Any) -> Any? { get }
```

## Parameters

- `key`: A shader variable or attribute name used in one of the technique’s shader programs.

## Return Value

Return Value An object containing the value of the shader symbol.

## Discussion

Discussion This method returns an object appropriate to the type of the shader symbol being set. For example, retrieving the value of a float uniform variable returns an NSNumber object, and retrieving the value of a GLSL vec3 uniform variable or Metal float3 variable returns an NSValue object containing an SCNVector3 structure.

## See Also

### Handling Parameters for a Technique’s Shader Programs

- [handleBinding(ofSymbol:using:)](scenekit/scntechnique/handlebinding(ofsymbol:using:).md)
- [setObject(_:forKeyedSubscript:)](scenekit/scntechnique/setobject(_:forkeyedsubscript:).md)
