---
title: "triangle(at:)"
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: "gameplaykit/gkmeshgraph/triangle(at:)"
---

# triangle(at:)

The triangle definition at the specified index.

## Declaration

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

## Parameters

- `index`: An index identifying the triangle. Must be less than the value of the doc://com.apple.gameplaykit/documentation/GameplayKit/GKMeshGraph/triangleCount property.

## Return Value

Return Value A structure describing the specified triangle.

## Discussion

Discussion This method provides valid results only after calling the 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.

## See Also

### Managing the Mesh

- [triangulate()](gameplaykit/gkmeshgraph/triangulate().md)
- [triangulationMode](gameplaykit/gkmeshgraph/triangulationmode.md)
- [triangleCount](gameplaykit/gkmeshgraph/trianglecount.md)
