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

# subscript(_:)

Returns the component at the specified index in the system’s list of components.

## Declaration

```swift
subscript(idx: Int) -> ComponentType { get }
```

## Parameters

- `idx`: A valid index to the doc://com.apple.gameplaykit/documentation/GameplayKit/GKComponentSystem/components array.

## Return Value

Return Value The component at the specified index in the components array.

## Discussion

Discussion This method is equivalent to accessing objects by index in the components array, but allows access using subscript syntax on the component system itself.
