<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNTechnique/subscript(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNTechnique(im)objectForKeyedSubscript:"
  },
  "title" : "subscript(_:)"
}
-->

# subscript(_:)

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

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

## Parameters

`key`

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

## Return Value

An object containing the value of the shader symbol.

## 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 <doc://com.apple.documentation/documentation/Foundation/NSNumber> object, and retrieving the value of a GLSL `vec3` uniform variable or Metal `float3` variable returns an <doc://com.apple.documentation/documentation/Foundation/NSValue> object containing an [`SCNVector3`](/documentation/SceneKit/SCNVector3) structure.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)