<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKMeshGraph/triangle(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKMeshGraph(im)triangleAtIndex:"
  },
  "title" : "triangle(at:)"
}
-->

# triangle(at:)

The triangle definition at the specified index.

```
func triangle(at index: Int) -> GKTriangle
```

## Parameters

`index`

An index identifying the triangle. Must be less than the value of the [`triangleCount`](/documentation/GameplayKit/GKMeshGraph/triangleCount) property.

## Return Value

A structure describing the specified triangle.

## Discussion

This method provides valid results only after calling the [`triangulate()`](/documentation/GameplayKit/GKMeshGraph/triangulate()) to create a mesh around the current configuration of obstacles. The information this method provides can be useful for drawing your own overlay UI to debug the graphs you create.

---

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)